+#if DISPATCH_COCOA_COMPAT
+DISPATCH_NOINLINE
+static void
+_dispatch_sync_slow(dispatch_queue_t dq, void (^work)(void))
+{
+ // Blocks submitted to the main queue MUST be run on the main thread,
+ // therefore under GC we must Block_copy in order to notify the thread-local
+ // garbage collector that the objects are transferring to the main thread
+ // rdar://problem/7176237&7181849&7458685
+ if (dispatch_begin_thread_4GC) {
+ dispatch_block_t block = _dispatch_Block_copy(work);
+ return dispatch_sync_f(dq, block, _dispatch_call_block_and_release);
+ }
+ struct Block_basic *bb = (void *)work;
+ dispatch_sync_f(dq, work, (dispatch_function_t)bb->Block_invoke);
+}
+#endif
+