diff options
author | Pixel <pixel@nobis-crew.org> | 2012-04-08 22:03:50 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2012-04-08 22:03:50 -0700 |
commit | cc78db0520ff384892cbee69557a38c3a1b04613 (patch) | |
tree | 01a05027d0d93d0a1253db56ed506087cc24aedb /includes | |
parent | dbf734fcf0ade3d92df31e4f0a7c0a5bd2b5605f (diff) |
Redifining yielding for operations a bit, making further refinements.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/Task.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/includes/Task.h b/includes/Task.h index 27ba4b1..9347dc4 100644 --- a/includes/Task.h +++ b/includes/Task.h @@ -151,12 +151,21 @@ class Task { Task * t = getCurrentTask(); t->waitFor(evt); } - static void yield(Events::BaseEvent * evt, bool interruptible = false) throw (GeneralException); + enum OperationYieldType { + SIMPLE, + INTERRUPTIBLE, + STACKLESS, + }; + static void operationYield(Events::BaseEvent * evt = NULL, enum OperationYieldType yieldType = SIMPLE) throw (GeneralException); TaskMan * getTaskMan() const { return m_taskMan; } struct ev_loop * getLoop(); bool isStackless() { return m_stackless; } protected: void yield(bool stillRunning = false) throw (GeneralException); + void yield(Events::BaseEvent * evt) { + waitFor(evt); + yield(); + } virtual void Do() = 0; void waitFor(Events::BaseEvent * event); bool setOkayToEAgain(bool enable) { |