in src/event/event.c [25:61]
static void _dispatch_timer_unote_register(dispatch_timer_source_refs_t dt,
dispatch_wlh_t wlh, dispatch_priority_t pri);
static void _dispatch_timer_unote_resume(dispatch_timer_source_refs_t dt);
static void _dispatch_timer_unote_unregister(dispatch_timer_source_refs_t dt);
DISPATCH_NOINLINE
static dispatch_unote_t
_dispatch_unote_create(dispatch_source_type_t dst,
uintptr_t handle, uintptr_t mask)
{
dispatch_unote_linkage_t dul;
dispatch_unote_class_t du;
if (mask & ~dst->dst_mask) {
return DISPATCH_UNOTE_NULL;
}
if (dst->dst_mask && !mask) {
return DISPATCH_UNOTE_NULL;
}
if (dst->dst_flags & EV_UDATA_SPECIFIC) {
du = _dispatch_calloc(1u, dst->dst_size);
} else {
dul = _dispatch_calloc(1u, sizeof(*dul) + dst->dst_size);
du = _dispatch_unote_linkage_get_unote(dul)._du;
}
du->du_type = dst;
du->du_can_be_wlh = dst->dst_per_trigger_qos;
du->du_ident = (dispatch_unote_ident_t)handle;
du->du_filter = dst->dst_filter;
du->du_fflags = (__typeof__(du->du_fflags))mask;
if (dst->dst_flags & EV_UDATA_SPECIFIC) {
du->du_is_direct = true;
}
return (dispatch_unote_t){ ._du = du };
}