object.h

OS_OBJECT_DECL_CLASS(dispatch_object);

void
_dispatch_object_validate(dispatch_object_t object) {
    void *isa = *(void* volatile*)(OS_OBJECT_BRIDGE void*)object;
    (void)isa;
}

typedef struct dispatch_object_s {
private:
    dispatch_object_s();
    ~dispatch_object_s();
    dispatch_object_s(const dispatch_object_s &);
    void operator=(const dispatch_object_s &);
} *dispatch_object_t;


typedef union {
    struct _os_object_s *_os_obj;
    struct dispatch_object_s *_do;
    struct dispatch_continuation_s *_dc;
    struct dispatch_queue_s *_dq;
    struct dispatch_queue_attr_s *_dqa;
    struct dispatch_group_s *_dg;
    struct dispatch_source_s *_ds;
    struct dispatch_mach_s *_dm;
    struct dispatch_mach_msg_s *_dmsg;
    struct dispatch_timer_aggregate_s *_dta;
    struct dispatch_source_attr_s *_dsa;
    struct dispatch_semaphore_s *_dsema;
    struct dispatch_data_s *_ddata;
    struct dispatch_io_s *_dchannel;
    struct dispatch_operation_s *_doperation;
    struct dispatch_disk_s *_ddisk;
} dispatch_object_t __attribute__((__transparent_union__));

 */
typedef void (^dispatch_block_t)(void);

void
dispatch_retain(dispatch_object_t object);

void
dispatch_release(dispatch_object_t object);

void *_Nullable
dispatch_get_context(dispatch_object_t object);

void
dispatch_set_context(dispatch_object_t object, void *_Nullable context);

void
dispatch_set_finalizer_f(dispatch_object_t object,
        dispatch_function_t _Nullable finalizer);

void
dispatch_activate(dispatch_object_t object);

void
dispatch_suspend(dispatch_object_t object);

void
dispatch_resume(dispatch_object_t object);

long
dispatch_wait(void *object, dispatch_time_t timeout);

void
dispatch_notify(void *object, dispatch_object_t queue,
        dispatch_block_t notification_block);

void
dispatch_cancel(void *object);

long
dispatch_testcancel(void *object);

__attribute__((__format__(printf,2,3)))
void
dispatch_debug(dispatch_object_t object, const char *message, ...);

__attribute__((__format__(printf,2,0)))
void
dispatch_debugv(dispatch_object_t object, const char *message, va_list ap);


你可能感兴趣的:(object.h)