Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Thread::Mutex to resolve race condition #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

okkez
Copy link
Member

@okkez okkez commented Sep 27, 2017

The problematic sequence:

  1. Add last line to @buffer
  2. Call flush_buffer in flush_timeout_buffer (via periodical timer)
  3. flush_buffer

Sequence 2 and 3 may race.

The problematic sequence:

1. Add last line to `@buffer`
2. Call `flush_buffer` in `flush_timeout_buffer` (via periodical timer)
3. `flush_buffer`

Sequence 2 and 3 may race.
@jdef
Copy link

jdef commented Sep 9, 2020

has this race otherwise been resolved?

@okkez
Copy link
Member Author

okkez commented Sep 11, 2020

This is very rare case. I cannot reproduce this race condition in my environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants