In the interceptor for dispatch_sync, we're currently missing synchronization between the callback and the code *after* the call to dispatch_sync. So we'll false report a race in:
// now executing on a background queue/thread dispatch_sync(main_queue, ^{ // "main_queue" forces the callback to be executed on a different thread x = 42; }); print(x); // back on the background_thread
This patch fixes this by adding an extra release+acquire pair to dispatch_sync() and similar APIs. Added a testcase.