+// If we fail to open the object, then we won't create an Add_symbols
+// task. However, we still need to unblock the token, or else the
+// link won't proceed to generate more error messages. We can only
+// unblock tokens in the main thread, so we need a dummy task to do
+// that. The dummy task has to maintain the right sequence of blocks,
+// so we need both this_blocker and next_blocker.
+
+class Unblock_token : public Task
+{
+ public:
+ Unblock_token(Task_token* this_blocker, Task_token* next_blocker)
+ : this_blocker_(this_blocker), next_blocker_(next_blocker)
+ { }
+
+ ~Unblock_token()
+ {
+ if (this->this_blocker_ != NULL)
+ delete this->this_blocker_;
+ }
+
+ Is_runnable_type
+ is_runnable(Workqueue*)
+ {
+ if (this->this_blocker_ != NULL && this->this_blocker_->is_blocked())
+ return IS_BLOCKED;
+ return IS_RUNNABLE;
+ }
+
+ Task_locker*
+ locks(Workqueue* workqueue)
+ { return new Task_locker_block(*this->next_blocker_, workqueue); }
+
+ void
+ run(Workqueue*)
+ { }
+
+ private:
+ Task_token* this_blocker_;
+ Task_token* next_blocker_;
+};
+