summaryrefslogtreecommitdiff
path: root/runtime/thread_pool.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/thread_pool.cc')
-rw-r--r--runtime/thread_pool.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/thread_pool.cc b/runtime/thread_pool.cc
index 0527d3ae14..5a4dfb8cfd 100644
--- a/runtime/thread_pool.cc
+++ b/runtime/thread_pool.cc
@@ -82,6 +82,11 @@ void ThreadPool::AddTask(Thread* self, Task* task) {
}
}
+void ThreadPool::RemoveAllTasks(Thread* self) {
+ MutexLock mu(self, task_queue_lock_);
+ tasks_.clear();
+}
+
ThreadPool::ThreadPool(const char* name, size_t num_threads)
: name_(name),
task_queue_lock_("task queue lock"),