aboutsummaryrefslogtreecommitdiff
path: root/gold/archive.h
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/archive.h
parent7004837e8d2e02ee35c50d236681e9c30a283619 (diff)
downloadfsf-binutils-gdb-17a1d0a9b26ce8f4f71073c41483baa0c10ed83b.zip
fsf-binutils-gdb-17a1d0a9b26ce8f4f71073c41483baa0c10ed83b.tar.gz
fsf-binutils-gdb-17a1d0a9b26ce8f4f71073c41483baa0c10ed83b.tar.bz2
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/archive.h')
-rw-r--r--gold/archive.h31
1 files changed, 20 insertions, 11 deletions
diff --git a/gold/archive.h b/gold/archive.h
index 57af167..b135cd6 100644
--- a/gold/archive.h
+++ b/gold/archive.h
@@ -31,6 +31,7 @@
namespace gold
{
+class Task;
class Input_file;
class Input_objects;
class Input_group;
@@ -64,7 +65,7 @@ class Archive
// Set up the archive: read the symbol map.
void
- setup();
+ setup(Task*);
// Get a reference to the underlying file.
File_read&
@@ -73,19 +74,29 @@ class Archive
// Lock the underlying file.
void
- lock()
- { this->input_file_->file().lock(); }
+ lock(const Task* t)
+ { this->input_file_->file().lock(t); }
// Unlock the underlying file.
void
- unlock()
- { this->input_file_->file().unlock(); }
+ unlock(const Task* t)
+ { this->input_file_->file().unlock(t); }
// Return whether the underlying file is locked.
bool
is_locked() const
{ return this->input_file_->file().is_locked(); }
+ // Return the token, so that the task can be queued.
+ Task_token*
+ token()
+ { return this->input_file_->file().token(); }
+
+ // Release the underlying file.
+ void
+ release()
+ { this->input_file_->file().release(); }
+
// Select members from the archive as needed and add them to the
// link.
void
@@ -178,11 +189,11 @@ class Add_archive_symbols : public Task
// The standard Task methods.
- Is_runnable_type
- is_runnable(Workqueue*);
+ Task_token*
+ is_runnable();
- Task_locker*
- locks(Workqueue*);
+ void
+ locks(Task_locker*);
void
run(Workqueue*);
@@ -196,8 +207,6 @@ class Add_archive_symbols : public Task
}
private:
- class Add_archive_symbols_locker;
-
Symbol_table* symtab_;
Layout* layout_;
Input_objects* input_objects_;