aboutsummaryrefslogtreecommitdiff
path: root/gold/workqueue.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2011-07-28 23:25:06 +0000
committerCary Coutant <ccoutant@google.com>2011-07-28 23:25:06 +0000
commitdcd8d12e1c020d87f7d3920438cf7327eb886008 (patch)
tree07df900db4681ba52b6ce1365e9f9b70e2afe40f /gold/workqueue.cc
parenta27e437177412e5b52999723f3c5d5d0d37b9087 (diff)
downloadgdb-dcd8d12e1c020d87f7d3920438cf7327eb886008.zip
gdb-dcd8d12e1c020d87f7d3920438cf7327eb886008.tar.gz
gdb-dcd8d12e1c020d87f7d3920438cf7327eb886008.tar.bz2
* workqueue-internal.h (Workqueue_threader::should_cancel_thread):
Add thread_number parameter. (Workqueue_threader_threadpool::should_cancel_thread): Likewise. * workqueue-threads.cc (Workqueue_threader_threadpool::should_cancel_thread): Cancel current thread if its thread number is greater than desired thread count. * workqueue.cc (Workqueue_threader_single::should_cancel_thread): Add thread_number parameter. (Workqueue::should_cancel_thread): Likewise. (Workqueue::find_runnable_or_wait): Pass thread_number to should_cancel_thread. * workqueue.h (Workqueue::should_cancel_thread): Add thread_number parameter.
Diffstat (limited to 'gold/workqueue.cc')
-rw-r--r--gold/workqueue.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gold/workqueue.cc b/gold/workqueue.cc
index 6449bba..e78e86b 100644
--- a/gold/workqueue.cc
+++ b/gold/workqueue.cc
@@ -110,7 +110,7 @@ class Workqueue_threader_single : public Workqueue_threader
{ gold_assert(thread_count > 0); }
bool
- should_cancel_thread()
+ should_cancel_thread(int)
{ return false; }
};
@@ -202,9 +202,9 @@ Workqueue::queue_next(Task* t)
// Return whether to cancel the current thread.
inline bool
-Workqueue::should_cancel_thread()
+Workqueue::should_cancel_thread(int thread_number)
{
- return this->threader_->should_cancel_thread();
+ return this->threader_->should_cancel_thread(thread_number);
}
// Find a runnable task in TASKS. Return NULL if none could be found.
@@ -264,7 +264,7 @@ Workqueue::find_runnable_or_wait(int thread_number)
return NULL;
}
- if (this->should_cancel_thread())
+ if (this->should_cancel_thread(thread_number))
return NULL;
gold_debug(DEBUG_TASK, "%3d sleeping", thread_number);