summaryrefslogtreecommitdiff
path: root/src/Task.cc
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-11-17 11:17:57 -0800
committerPixel <pixel@nobis-crew.org>2011-11-17 11:17:57 -0800
commit2cb2961c9f6062e867b6ccc3d9067f55c7b81ea4 (patch)
tree7846e0849a6f2cde216596a1ab144a69c50f5a60 /src/Task.cc
parente435e4bb3c0744acf5b36c6e441d309d10af1257 (diff)
Cleaning some code, redesigning a bit the stack allocation problem from the task manager, and actually implementing it properly.
Diffstat (limited to 'src/Task.cc')
-rw-r--r--src/Task.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Task.cc b/src/Task.cc
index d72decc..440ed0e 100644
--- a/src/Task.cc
+++ b/src/Task.cc
@@ -21,12 +21,14 @@ bool Balau::Task::needsStacks() {
#endif
}
-void Balau::Task::setup(TaskMan * taskMan) {
+void Balau::Task::setup(TaskMan * taskMan, void * stack) {
size_t size = stackSize();
#ifndef _WIN32
- m_stack = taskMan->getStack();
+ Assert(stack);
+ m_stack = stack;
coro_create(&m_ctx, coroutineTrampoline, this, m_stack, size);
#else
+ Assert(!stack);
m_stack = NULL;
m_fiber = CreateFiber(size, coroutineTrampoline, this);
#endif