From ae4d1cfcbbe4c6130bd6370a03f546993a37f567 Mon Sep 17 00:00:00 2001 From: Pixel Date: Mon, 12 Nov 2001 22:20:50 +0000 Subject: Cleaning includes, progressing taskman... --- lib/Task.cc | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'lib/Task.cc') 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); } -- cgit v1.2.3