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

Corrected rare deadlock condition on observable.as_blocking().subscribe() #543

Merged

Conversation

quetzalcoatl
Copy link
Contributor

Previously flag was set after pinging the condition variable, so waiting thread could woke up before the flag was set, and then the thread entered sleep again since condition was not met (yet). The problem was, nothing ever woke this thread as the "cs" was already spent. On some platforms the threads could actually wake up due to https://en.wikipedia.org/wiki/Spurious_wakeup but that's not guaranteed to ever happen.

…be()

Previously flag was set after pinging the condition variable, so waiting thread could woke up before the flag was set, and then the thread entered sleep again since condition was not met (yet). The problem was, nothing ever woke this thread as the "cs" was already spent. On some platforms the threads could actually wake up due to https://en.wikipedia.org/wiki/Spurious_wakeup but that's not guaranteed to ever happen.
@kirkshoop kirkshoop merged commit d7be601 into ReactiveX:master Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants