Skip to content

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

Merged
kirkshoop merged 1 commit intoReactiveX:masterfrom
quetzalcoatl:fix-deadlock-in-asblockingsubscribe
Aug 22, 2020
Merged

Corrected rare deadlock condition on observable.as_blocking().subscribe()#543
kirkshoop merged 1 commit intoReactiveX:masterfrom
quetzalcoatl:fix-deadlock-in-asblockingsubscribe

Conversation

@quetzalcoatl
Copy link
Copy Markdown
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.

2 participants