source.h

DISPATCH_SOURCE_DECL(dispatch_source);
typedef const struct dispatch_source_type_s *dispatch_source_type_t;

typedef unsigned long dispatch_source_mach_send_flags_t;

typedef unsigned long dispatch_source_memorypressure_flags_t;

typedef unsigned long dispatch_source_proc_flags_t;

typedef unsigned long dispatch_source_vnode_flags_t;

typedef unsigned long dispatch_source_timer_flags_t;

dispatch_source_t
dispatch_source_create(dispatch_source_type_t type,
    uintptr_t handle,
    unsigned long mask,
    dispatch_queue_t _Nullable queue);

void
dispatch_source_set_event_handler(dispatch_source_t source,
    dispatch_block_t _Nullable handler);

void
dispatch_source_set_event_handler_f(dispatch_source_t source,
    dispatch_function_t _Nullable handler);

void
dispatch_source_set_cancel_handler(dispatch_source_t source,
    dispatch_block_t _Nullable handler);

void
dispatch_source_set_cancel_handler_f(dispatch_source_t source,
    dispatch_function_t _Nullable handler);
void
dispatch_source_cancel(dispatch_source_t source);

long
dispatch_source_testcancel(dispatch_source_t source);

uintptr_t
dispatch_source_get_handle(dispatch_source_t source);

unsigned long
dispatch_source_get_mask(dispatch_source_t source);

unsigned long
dispatch_source_get_data(dispatch_source_t source);

void
dispatch_source_merge_data(dispatch_source_t source, unsigned long value);

void
dispatch_source_set_timer(dispatch_source_t source,
    dispatch_time_t start,
    uint64_t interval,
    uint64_t leeway);

void
dispatch_source_set_registration_handler(dispatch_source_t source,
    dispatch_block_t _Nullable handler);

void
dispatch_source_set_registration_handler_f(dispatch_source_t source,
    dispatch_function_t _Nullable handler);

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容