Lines Matching refs:task
48 struct threadpool_task *task; in threadpool_worker() local
63 task = pool->workqueue; in threadpool_worker()
64 pool->workqueue = task->next; in threadpool_worker()
68 task->work(task->data); in threadpool_worker()
70 task->finished = TRUE; in threadpool_worker()
71 pthread_cond_broadcast(&task->finish); in threadpool_worker()
135 struct threadpool_task *task, *previous; in _mesa_threadpool_queue_task() local
142 task = calloc(1, sizeof(*task)); in _mesa_threadpool_queue_task()
143 if (!task) { in _mesa_threadpool_queue_task()
148 task->work = work; in _mesa_threadpool_queue_task()
149 task->data = data; in _mesa_threadpool_queue_task()
150 task->next = NULL; in _mesa_threadpool_queue_task()
151 pthread_cond_init(&task->finish, NULL); in _mesa_threadpool_queue_task()
156 pool->workqueue = task; in _mesa_threadpool_queue_task()
162 previous->next = task; in _mesa_threadpool_queue_task()
167 return task; in _mesa_threadpool_queue_task()
177 struct threadpool_task *task = *task_handle; in _mesa_threadpool_wait_for_task() local
179 if (!pool || !task) in _mesa_threadpool_wait_for_task()
183 while (!task->finished) in _mesa_threadpool_wait_for_task()
184 pthread_cond_wait(&task->finish, &pool->m); in _mesa_threadpool_wait_for_task()
187 pthread_cond_destroy(&task->finish); in _mesa_threadpool_wait_for_task()
188 free(task); in _mesa_threadpool_wait_for_task()