summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2012-04-08 09:42:51 -0700
committerPixel <pixel@nobis-crew.org>2012-04-08 09:43:59 -0700
commit0fb5f42ca43f11bd37ddc89aa7c7b098d764b28c (patch)
tree516d08db4abb8691c61ac6e05a1f944503e98be3 /includes
parent9f0431d84807e37bfa63bd144dcb4d2235fe7772 (diff)
Further refinements and protections in the stackless base.
Diffstat (limited to 'includes')
-rw-r--r--includes/Task.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/includes/Task.h b/includes/Task.h
index db602f0..b5f5540 100644
--- a/includes/Task.h
+++ b/includes/Task.h
@@ -158,6 +158,9 @@ class Task {
virtual void Do() = 0;
void waitFor(Events::BaseEvent * event);
bool setOkayToEAgain(bool enable) {
+ if (m_stackless) {
+ AAssert(enable, "You can't make a task go not-okay-to-eagain if it's stackless.");
+ }
bool oldValue = m_okayToEAgain;
m_okayToEAgain = enable;
return oldValue;
@@ -166,6 +169,7 @@ class Task {
AAssert(m_stackless, "Can't set a task to be stackless twice");
AAssert(m_status == STARTING, "Can't set a task to be stackless after it started. status = %s", StatusToString(m_status));
m_stackless = true;
+ m_okayToEAgain = true;
}
private:
static size_t stackSize() { return 64 * 1024; }