summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-10-14 00:46:44 -0700
committerPixel <pixel@nobis-crew.org>2011-10-14 00:46:44 -0700
commit4a82f5ff9e3d88e333cce43f19eb8685ee124e3e (patch)
tree3ef7cc89f7956775962f6341ed640a73196000ca /includes
parent13684e6c58ed3f0bd6fd811125e31fc3a37bda21 (diff)
Making sure that external task yields are able to complete their subactions. Hence removing a few now unnecessary asserts.
Diffstat (limited to 'includes')
-rw-r--r--includes/Task.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/Task.h b/includes/Task.h
index c4d9a46..1fca27e 100644
--- a/includes/Task.h
+++ b/includes/Task.h
@@ -71,7 +71,14 @@ class Task {
virtual const char * getName() = 0;
Status getStatus() { return m_status; }
static Task * getCurrentTask();
- static void yield(Events::BaseEvent * evt) { Task * t = getCurrentTask(); t->waitFor(evt, true); t->yield(true); }
+ static void yield(Events::BaseEvent * evt, bool interruptible = false) {
+ Task * t = getCurrentTask();
+ t->waitFor(evt, true);
+
+ do {
+ t->yield(true);
+ } while (!interruptible && !evt->gotSignal());
+ }
TaskMan * getTaskMan() { return m_taskMan; }
struct ev_loop * getLoop();
protected: