static VALUE rb_queue_dispatch_barrier_async(VALUE self, SEL sel) { rb_vm_block_t *block = get_prepared_block(); dispatch_barrier_async_f(RQueue(self)->queue, (void *)block, rb_block_dispatcher); return Qnil; }
void dispatch_source_set_event_handler(dispatch_source_t ds, dispatch_block_t handler) { dispatch_assert(!ds->ds_is_legacy); handler = _dispatch_Block_copy(handler); dispatch_barrier_async_f((dispatch_queue_t)ds, handler, _dispatch_source_set_event_handler2); }
void dispatch_source_set_cancel_handler_f(dispatch_source_t ds, dispatch_function_t handler) { dispatch_assert(!ds->ds_is_legacy); dispatch_barrier_async_f((dispatch_queue_t)ds, handler, _dispatch_source_set_cancel_handler_f); }
static void apply_fn(void* ctxt, size_t idx) { dispatch_sync_f(dq, NULL, reader); if (idx % INTERVAL) { dispatch_barrier_async_f(dq, NULL, writer); } }