• Home
  • Raw
  • Download

Lines Matching refs:thread

48   thread_t *thread;  member
86 start.thread = ret; in thread_new_sized()
110 void thread_free(thread_t *thread) { in thread_free() argument
111 if (!thread) in thread_free()
114 thread_stop(thread); in thread_free()
115 thread_join(thread); in thread_free()
117 fixed_queue_free(thread->work_queue, osi_free); in thread_free()
118 reactor_free(thread->reactor); in thread_free()
119 osi_free(thread); in thread_free()
122 void thread_join(thread_t *thread) { in thread_join() argument
123 assert(thread != NULL); in thread_join()
126 if (!thread->is_joined) { in thread_join()
127 thread->is_joined = true; in thread_join()
128 pthread_join(thread->pthread, NULL); in thread_join()
132 bool thread_post(thread_t *thread, thread_fn func, void *context) { in thread_post() argument
133 assert(thread != NULL); in thread_post()
149 fixed_queue_enqueue(thread->work_queue, item); in thread_post()
153 void thread_stop(thread_t *thread) { in thread_stop() argument
154 assert(thread != NULL); in thread_stop()
155 reactor_stop(thread->reactor); in thread_stop()
158 bool thread_set_priority(thread_t *thread, int priority) { in thread_set_priority() argument
159 if (!thread) in thread_set_priority()
162 const int rc = setpriority(PRIO_PROCESS, thread->tid, priority); in thread_set_priority()
165 __func__, priority, thread->tid, rc); in thread_set_priority()
172 bool thread_is_self(const thread_t *thread) { in thread_is_self() argument
173 assert(thread != NULL); in thread_is_self()
174 return !!pthread_equal(pthread_self(), thread->pthread); in thread_is_self()
177 reactor_t *thread_get_reactor(const thread_t *thread) { in thread_get_reactor() argument
178 assert(thread != NULL); in thread_get_reactor()
179 return thread->reactor; in thread_get_reactor()
182 const char *thread_name(const thread_t *thread) { in thread_name() argument
183 assert(thread != NULL); in thread_name()
184 return thread->name; in thread_name()
191 thread_t *thread = start->thread; in run_thread() local
193 assert(thread != NULL); in run_thread()
195 if (prctl(PR_SET_NAME, (unsigned long)thread->name) == -1) { in run_thread()
201 thread->tid = gettid(); in run_thread()
205 int fd = fixed_queue_get_dequeue_fd(thread->work_queue); in run_thread()
206 void *context = thread->work_queue; in run_thread()
208 …reactor_object_t *work_queue_object = reactor_register(thread->reactor, fd, context, work_queue_re… in run_thread()
209 reactor_start(thread->reactor); in run_thread()
216 work_item_t *item = fixed_queue_try_dequeue(thread->work_queue); in run_thread()
217 while (item && count <= fixed_queue_capacity(thread->work_queue)) { in run_thread()
220 item = fixed_queue_try_dequeue(thread->work_queue); in run_thread()
224 if (count > fixed_queue_capacity(thread->work_queue)) in run_thread()