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