summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/Task.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/includes/Task.h b/includes/Task.h
index 27cb0bc..26d2c65 100644
--- a/includes/Task.h
+++ b/includes/Task.h
@@ -167,9 +167,7 @@ class Task {
struct ev_loop * getLoop();
bool isStackless() { return m_stackless; }
protected:
- void yield(Events::BaseEvent * evt = NULL) throw (GeneralException) {
- if (evt)
- waitFor(evt);
+ void yield() throw (GeneralException) {
if (yield(false))
throw EAgain(NULL);
}
@@ -191,6 +189,11 @@ class Task {
m_okayToEAgain = true;
}
private:
+ void yield(Events::BaseEvent * evt) throw (GeneralException) {
+ waitFor(evt);
+ if (yield(false))
+ throw EAgain(NULL);
+ }
bool yield(bool stillRunning);
static size_t stackSize() { return 64 * 1024; }
void setup(TaskMan * taskMan, void * stack);