Lines Matching refs:self

49   Thread* self = Thread::Current();  in Run()  local
51 thread_pool_->creation_barier_.Wait(self); in Run()
52 while ((task = thread_pool_->GetTask(self)) != NULL) { in Run()
53 task->Run(self); in Run()
68 void ThreadPool::AddTask(Thread* self, Task* task) { in AddTask() argument
69 MutexLock mu(self, task_queue_lock_); in AddTask()
73 task_queue_condition_.Signal(self); in AddTask()
90 Thread* self = Thread::Current(); in ThreadPool() local
96 creation_barier_.Wait(self); in ThreadPool()
107 Thread* self = Thread::Current(); in ~ThreadPool() local
108 MutexLock mu(self, task_queue_lock_); in ~ThreadPool()
112 task_queue_condition_.Broadcast(self); in ~ThreadPool()
113 completion_condition_.Broadcast(self); in ~ThreadPool()
119 void ThreadPool::StartWorkers(Thread* self) { in StartWorkers() argument
120 MutexLock mu(self, task_queue_lock_); in StartWorkers()
122 task_queue_condition_.Broadcast(self); in StartWorkers()
127 void ThreadPool::StopWorkers(Thread* self) { in StopWorkers() argument
128 MutexLock mu(self, task_queue_lock_); in StopWorkers()
132 Task* ThreadPool::GetTask(Thread* self) { in GetTask() argument
133 MutexLock mu(self, task_queue_lock_); in GetTask()
140 Task* task = TryGetTaskLocked(self); in GetTask()
149 completion_condition_.Broadcast(self); in GetTask()
152 task_queue_condition_.Wait(self); in GetTask()
164 Task* ThreadPool::TryGetTask(Thread* self) { in TryGetTask() argument
165 MutexLock mu(self, task_queue_lock_); in TryGetTask()
166 return TryGetTaskLocked(self); in TryGetTask()
169 Task* ThreadPool::TryGetTaskLocked(Thread* self) { in TryGetTaskLocked() argument
178 void ThreadPool::Wait(Thread* self, bool do_work, bool may_hold_locks) { in Wait() argument
181 while ((task = TryGetTask(self)) != NULL) { in Wait()
182 task->Run(self); in Wait()
187 MutexLock mu(self, task_queue_lock_); in Wait()
190 completion_condition_.Wait(self); in Wait()
192 completion_condition_.WaitHoldingLocks(self); in Wait()
197 size_t ThreadPool::GetTaskCount(Thread* self) { in GetTaskCount() argument
198 MutexLock mu(self, task_queue_lock_); in GetTaskCount()
207 Thread* self = Thread::Current(); in Run() local
210 while ((task = thread_pool_->GetTask(self)) != NULL) { in Run()
215 MutexLock mu(self, thread_pool->work_steal_lock_); in Run()
220 stealing_task->Run(self); in Run()
231 while (thread_pool->GetTaskCount(self) == 0) { in Run()
235 MutexLock mu(self, thread_pool->work_steal_lock_); in Run()
237 steal_from_task = thread_pool->FindTaskToStealFrom(self); in Run()
249 stealing_task->StealFrom(self, steal_from_task); in Run()
253 MutexLock mu(self, thread_pool->work_steal_lock_); in Run()
264 MutexLock mu(self, thread_pool->work_steal_lock_); in Run()
287 WorkStealingTask* WorkStealingThreadPool::FindTaskToStealFrom(Thread* self) { in FindTaskToStealFrom() argument