summaryrefslogtreecommitdiff
path: root/includes/Task.h
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2012-04-08 22:03:50 -0700
committerPixel <pixel@nobis-crew.org>2012-04-08 22:03:50 -0700
commitcc78db0520ff384892cbee69557a38c3a1b04613 (patch)
tree01a05027d0d93d0a1253db56ed506087cc24aedb /includes/Task.h
parentdbf734fcf0ade3d92df31e4f0a7c0a5bd2b5605f (diff)
Redifining yielding for operations a bit, making further refinements.
Diffstat (limited to 'includes/Task.h')
-rw-r--r--includes/Task.h11
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) {