void thread_call_setup( thread_call_t call, thread_call_func_t func, thread_call_param_t param0) { call_entry_setup(call, func, param0); }
void timer_call_setup( timer_call_t call, timer_call_func_t func, timer_call_param_t param0) { call_entry_setup(call, func, param0); }
void thread_call_setup( thread_call_t call, thread_call_func_t func, thread_call_param_t param0) { bzero(call, sizeof(*call)); call_entry_setup((call_entry_t)call, func, param0); call->tc_pri = THREAD_CALL_PRIORITY_HIGH; /* Default priority */ }
void timer_call_setup( timer_call_t call, timer_call_func_t func, timer_call_param_t param0) { DBG("timer_call_setup(%p,%p,%p)\n", call, func, param0); call_entry_setup(CE(call), func, param0); simple_lock_init(&(call)->lock, 0); call->async_dequeue = FALSE; }
/* * thread_call_allocate: * * Allocate a callout entry. */ thread_call_t thread_call_allocate( thread_call_func_t func, thread_call_param_t param0) { thread_call_t call = zalloc(thread_call_zone); call_entry_setup(call, func, param0); return (call); }
mach_port_name_t mk_timer_create_trap( __unused struct mk_timer_create_trap_args *args) { mk_timer_t timer; ipc_space_t myspace = current_space(); mach_port_name_t name = MACH_PORT_NULL; ipc_port_t port; kern_return_t result; timer = (mk_timer_t)zalloc(mk_timer_zone); if (timer == NULL) return (MACH_PORT_NULL); result = mach_port_allocate_qos(myspace, MACH_PORT_RIGHT_RECEIVE, &mk_timer_qos, &name); if (result == KERN_SUCCESS) result = ipc_port_translate_receive(myspace, name, &port); if (result != KERN_SUCCESS) { zfree(mk_timer_zone, timer); return (MACH_PORT_NULL); } simple_lock_init(&timer->lock, 0); call_entry_setup(&timer->call_entry, mk_timer_expire, timer); timer->is_armed = timer->is_dead = FALSE; timer->active = 0; timer->port = port; ipc_kobject_set_atomically(port, (ipc_kobject_t)timer, IKOT_TIMER); port->ip_srights++; ip_reference(port); ip_unlock(port); return (name); }