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

Fix completed var thread safety problem #307

Conversation

Mourad-Aly
Copy link

@Mourad-Aly Mourad-Aly commented Sep 19, 2017

Hi,

I've faced racing condition while using Bolts in our Apps, same issue reported before #302
Hot fix is to ensure locking the completed variable, however I don't know why wasn't it already in the lock block (deadlock?)? This is why I'm submitting this PR to ensure that the server tests will not fail since I'm unable to run tests locally (will figure this out).
I'd suggest handling thread safety for BFTask in an easier-to-read way than locks, what do you think? GCD for example, sync_barrier?

Updates: I've just seen #303 👍

@Mourad-Aly
Copy link
Author

Hi @nlutsenko,
Seems a deadlock, since self.condition will wait in self.lock, and self.condition's signaling is happening in another self.lock block as well. I'm running tests locally to check whether it's caught by tests or not.
Any concern is appreciated. Thanks.

@Mourad-Aly Mourad-Aly closed this Sep 19, 2017
@Mourad-Aly Mourad-Aly deleted the BFTask-completion-thread-safety branch September 19, 2017 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants