static void *routine(void *arg) { struct thread_arg *_arg = (struct thread_arg *)arg; thread_t t = _arg->_thread; void *custom_arg = _arg->custom_arg; thread_routine custom_routine = _arg->custom_routine; custom_routine(custom_arg); destroy_thread(&t); free(_arg); return 0; }
static void *routine(void *arg) { kn_thread_arg *_arg = (kn_thread_arg *)arg; kn_thread_t t = _arg->_thread; void *custom_arg = _arg->custom_arg; kn_thread_routine custom_routine = _arg->custom_routine; custom_routine(custom_arg); kn_thread_destroy(t); free(_arg); return 0; }