summaryrefslogtreecommitdiff
path: root/gold/dirsearch.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-12-14 19:00:21 +0000
committerIan Lance Taylor <iant@google.com>2007-12-14 19:00:21 +0000
commit17a1d0a9b26ce8f4f71073c41483baa0c10ed83b (patch)
tree3cdd95751145e2cf1cbcaedee2df8790c86b935d /gold/dirsearch.cc
parent7004837e8d2e02ee35c50d236681e9c30a283619 (diff)
Rewrite workqueue. This version eliminates the master thread, and
reduces the amount of locking required to find a new thread to run.
Diffstat (limited to 'gold/dirsearch.cc')
-rw-r--r--gold/dirsearch.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/gold/dirsearch.cc b/gold/dirsearch.cc
index dd1c7e6eb2..960c8eb4e5 100644
--- a/gold/dirsearch.cc
+++ b/gold/dirsearch.cc
@@ -28,6 +28,8 @@
#include <dirent.h>
#include "gold-threads.h"
+#include "options.h"
+#include "workqueue.h"
#include "dirsearch.h"
namespace
@@ -169,11 +171,11 @@ class Dir_cache_task : public gold::Task
: dir_(dir), token_(token)
{ }
- Is_runnable_type
- is_runnable(gold::Workqueue*);
+ gold::Task_token*
+ is_runnable();
- gold::Task_locker*
- locks(gold::Workqueue*);
+ void
+ locks(gold::Task_locker*);
void
run(gold::Workqueue*);
@@ -189,19 +191,19 @@ class Dir_cache_task : public gold::Task
// We can always run the task to read the directory.
-gold::Task::Is_runnable_type
-Dir_cache_task::is_runnable(gold::Workqueue*)
+gold::Task_token*
+Dir_cache_task::is_runnable()
{
- return IS_RUNNABLE;
+ return NULL;
}
// Return the locks to hold. We use a blocker lock to prevent file
// lookups from starting until the directory contents have been read.
-gold::Task_locker*
-Dir_cache_task::locks(gold::Workqueue* workqueue)
+void
+Dir_cache_task::locks(gold::Task_locker* tl)
{
- return new gold::Task_locker_block(this->token_, workqueue);
+ tl->add(this, &this->token_);
}
// Run the task--read the directory contents.