// workqueue.cc -- the workqueue for gold
-// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
// waiting for a Token.
void
-Workqueue::add_to_queue(Task_list* queue, Task* t, bool front)
+Workqueue::add_to_queue(Task_list* que, Task* t, bool front)
{
Hold_lock hl(this->lock_);
else
{
if (front)
- queue->push_front(t);
+ que->push_front(t);
else
- queue->push_back(t);
+ que->push_back(t);
// Tell any waiting thread that there is work to do.
this->condvar_.signal();
}
{
// The token has been unblocked. Every waiting Task may
// now be runnable.
- Task* t;
- while ((t = token->remove_first_waiting()) != NULL)
+ Task* tok;
+ while ((tok = token->remove_first_waiting()) != NULL)
{
--this->waiting_;
- this->return_or_queue(t, true, &ret);
+ this->return_or_queue(tok, true, &ret);
}
}
}
// move all the Tasks to the runnable queue, to avoid a
// potential deadlock if the locking status changes before
// we run the next thread.
- Task* t;
- while ((t = token->remove_first_waiting()) != NULL)
+ Task* tok;
+ while ((tok = token->remove_first_waiting()) != NULL)
{
--this->waiting_;
- if (this->return_or_queue(t, false, &ret))
+ if (this->return_or_queue(tok, false, &ret))
break;
}
}