OMPromises
OMPromises copied to clipboard
Thread-safe access to [OMPromise state]
When I run my app with Xcode's Thread sanitizer enabled, I get an issue reported where read access to the 'state' property is not properly guarded (see attached screenshot). This could be fixed by either declaring the 'state' property as atomic, or by putting the read access within the @synchronized clause.
Any ideas what would be the best route to fix this?
You are right, that this is indeed a data race. But the solution is to drop the self on that particular line and use the previously requested value.
I do not have the time to fix that right now, but if you could change that and write a PR I would happily merge that.