diff options
Diffstat (limited to 'lib/Task.cc')
-rw-r--r-- | lib/Task.cc | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/lib/Task.cc b/lib/Task.cc index c34d0e3..2db8ce5 100644 --- a/lib/Task.cc +++ b/lib/Task.cc @@ -37,26 +37,24 @@ String Task::GetName() { return "Unknow Task"; } -int Task::Suspend() throw (GeneralException) { - int r; - +void Task::Suspend() throw (GeneralException) { cerr << "Suspending task " << GetName() << "...\n"; - suspended = true; - - r = setjmp(env); - - if (!r) throw TaskSwitch(); - - return r; + throw TaskSwitch(); } -void Task::Resume(int val) throw (GeneralException) { - cerr << "Resuming task " << GetName() << "...\n"; - if (suspended) { - suspended = false; - longjmp(env, val); - } else { - throw GeneralException(String("Task ") + GetName() + " was not suspended."); - } +void WaitFor(Handle * h) { + w4ha.push_back(h); +} + +void WaitFor(Task * t) { + w4ta.push_back(t); +} + +void WaitFor(pid_t p) { + w4pr.push_back(p); +} + +void WaitFor(struct timeval t) { + w4to.push_back(t); } |