summaryrefslogtreecommitdiff
path: root/gold/testsuite/object_unittest.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/testsuite/object_unittest.cc
parent7004837e8d2e02ee35c50d236681e9c30a283619 (diff)
downloadbinutils-gdb-17a1d0a9b26ce8f4f71073c41483baa0c10ed83b.tar.gz
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/testsuite/object_unittest.cc')
-rw-r--r--gold/testsuite/object_unittest.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/gold/testsuite/object_unittest.cc b/gold/testsuite/object_unittest.cc
index 9b03425eea7..4510e0c4fd5 100644
--- a/gold/testsuite/object_unittest.cc
+++ b/gold/testsuite/object_unittest.cc
@@ -39,22 +39,24 @@ bool
Sized_object_test(const unsigned char* test_file, unsigned int test_file_size,
Target* target_test_pointer)
{
- Input_file input_file("test.o", test_file, test_file_size);
+ // We need a pretend Task.
+ const Task* task = reinterpret_cast<const Task*>(-1);
+ Input_file input_file(task, "test.o", test_file, test_file_size);
Object* object = make_elf_object("test.o", &input_file, 0,
test_file, test_file_size);
CHECK(object->name() == "test.o");
CHECK(!object->is_dynamic());
CHECK(object->target() == target_test_pointer);
CHECK(object->is_locked());
- object->unlock();
+ object->unlock(task);
CHECK(!object->is_locked());
- object->lock();
+ object->lock(task);
CHECK(object->shnum() == 5);
CHECK(object->section_name(0).empty());
CHECK(object->section_name(1) == ".test");
CHECK(object->section_flags(0) == 0);
CHECK(object->section_flags(1) == elfcpp::SHF_ALLOC);
- object->unlock();
+ object->unlock(task);
return true;
}