• Home
  • Raw
  • Download

Lines Matching full:task

31         struct threadpool_task *task;  in threadpool_worker()  local
40 /* Pull the first task from the list. We don't free it -- it now lacks in threadpool_worker()
44 task = pool->workqueue; in threadpool_worker()
45 pool->workqueue = task->next; in threadpool_worker()
47 /* Call the task's work func. */ in threadpool_worker()
49 task->work(task->data); in threadpool_worker()
51 task->finished = true; in threadpool_worker()
52 pthread_cond_broadcast(&task->finish); in threadpool_worker()
127 struct threadpool_task *task, *previous; in _mesa_threadpool_queue_task() local
134 task = calloc(1, sizeof(*task)); in _mesa_threadpool_queue_task()
135 if (!task) { in _mesa_threadpool_queue_task()
140 task->work = work; in _mesa_threadpool_queue_task()
141 task->data = data; in _mesa_threadpool_queue_task()
142 task->next = NULL; in _mesa_threadpool_queue_task()
143 pthread_cond_init(&task->finish, NULL); in _mesa_threadpool_queue_task()
148 pool->workqueue = task; in _mesa_threadpool_queue_task()
154 previous->next = task; in _mesa_threadpool_queue_task()
159 return task; in _mesa_threadpool_queue_task()
163 * Blocks on the completion of the given task and frees the task.
169 struct threadpool_task *task = *task_handle; in _mesa_threadpool_wait_for_task() local
171 if (!pool || !task) in _mesa_threadpool_wait_for_task()
175 while (!task->finished) in _mesa_threadpool_wait_for_task()
176 pthread_cond_wait(&task->finish, &pool->m); in _mesa_threadpool_wait_for_task()
179 pthread_cond_destroy(&task->finish); in _mesa_threadpool_wait_for_task()
180 free(task); in _mesa_threadpool_wait_for_task()