Lines Matching refs:p_thread

52 	cl_thread_t *p_thread = (cl_thread_t *) arg;  in __cl_thread_wrapper()  local
54 CL_ASSERT(p_thread); in __cl_thread_wrapper()
55 CL_ASSERT(p_thread->pfn_callback); in __cl_thread_wrapper()
57 p_thread->pfn_callback((void *)p_thread->context); in __cl_thread_wrapper()
62 void cl_thread_construct(IN cl_thread_t * const p_thread) in cl_thread_construct() argument
64 CL_ASSERT(p_thread); in cl_thread_construct()
66 p_thread->osd.state = CL_UNINITIALIZED; in cl_thread_construct()
69 cl_status_t cl_thread_init(IN cl_thread_t * const p_thread, in cl_thread_init() argument
76 CL_ASSERT(p_thread); in cl_thread_init()
78 cl_thread_construct(p_thread); in cl_thread_init()
81 p_thread->pfn_callback = pfn_callback; in cl_thread_init()
82 p_thread->context = context; in cl_thread_init()
84 ret = pthread_create(&p_thread->osd.id, NULL, in cl_thread_init()
85 __cl_thread_wrapper, (void *)p_thread); in cl_thread_init()
90 p_thread->osd.state = CL_INITIALIZED; in cl_thread_init()
95 void cl_thread_destroy(IN cl_thread_t * const p_thread) in cl_thread_destroy() argument
97 CL_ASSERT(p_thread); in cl_thread_destroy()
98 CL_ASSERT(cl_is_state_valid(p_thread->osd.state)); in cl_thread_destroy()
100 if (p_thread->osd.state == CL_INITIALIZED) in cl_thread_destroy()
101 pthread_join(p_thread->osd.id, NULL); in cl_thread_destroy()
103 p_thread->osd.state = CL_UNINITIALIZED; in cl_thread_destroy()
131 boolean_t cl_is_current_thread(IN const cl_thread_t * const p_thread) in cl_is_current_thread() argument
135 CL_ASSERT(p_thread); in cl_is_current_thread()
136 CL_ASSERT(p_thread->osd.state == CL_INITIALIZED); in cl_is_current_thread()
139 return (pthread_equal(current, p_thread->osd.id)); in cl_is_current_thread()