Created by: Mourad-Aly
Hi,
I've faced racing condition while using Bolts in our Apps, same issue reported before https://github.com/BoltsFramework/Bolts-ObjC/issues/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 https://github.com/BoltsFramework/Bolts-ObjC/pull/303