aboutsummaryrefslogtreecommitdiff
path: root/gold/object.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/object.h
parent7004837e8d2e02ee35c50d236681e9c30a283619 (diff)
downloadgdb-17a1d0a9b26ce8f4f71073c41483baa0c10ed83b.zip
gdb-17a1d0a9b26ce8f4f71073c41483baa0c10ed83b.tar.gz
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/object.h')
-rw-r--r--gold/object.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/gold/object.h b/gold/object.h
index 1fcdd10..a43ef0c 100644
--- a/gold/object.h
+++ b/gold/object.h
@@ -35,6 +35,7 @@ namespace gold
{
class General_options;
+class Task;
class Layout;
class Output_section;
class Output_file;
@@ -165,19 +166,29 @@ class Object
// 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(); }
+
// Return the sized target structure associated with this object.
// This is like the target method but it returns a pointer of
// appropriate checked type.
@@ -322,7 +333,7 @@ class Object
virtual unsigned int
do_section_info(unsigned int shndx) = 0;
- // Get the file.
+ // Get the file. We pass on const-ness.
Input_file*
input_file()
{ return this->input_file_; }
@@ -508,7 +519,7 @@ class Relobj : public Object
// any relocations for sections which require special handling, such
// as the exception frame section.
bool
- relocs_must_follow_section_writes()
+ relocs_must_follow_section_writes() const
{ return this->relocs_must_follow_section_writes_; }
// Return the object merge map.
@@ -1101,7 +1112,7 @@ class Sized_relobj : public Relobj
// Write section data to the output file. Record the views and
// sizes in VIEWS for use when relocating.
void
- write_sections(const unsigned char* pshdrs, Output_file*, Views*);
+ write_sections(const unsigned char* pshdrs, Output_file*, Views*) const;
// Relocate the sections in the output file.
void