summaryrefslogtreecommitdiff
path: root/src/TaskMan.cc
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-10-18 16:37:49 -0700
committerPixel <pixel@nobis-crew.org>2011-10-18 16:37:49 -0700
commit0db120afdfb818421dc5df3dc0946fafede78c93 (patch)
treee47403f57bcc39471d6c994c4f2951f4eb9ba108 /src/TaskMan.cc
parent4e07ceeb21dae4b6b8d5eaf7421228f735f14bda (diff)
libcoro seems to be doing really spurious things when not using the standard functions.
Switching out libcoro for the native Fibers interface for Win32. Switching out the asm version for the ucontext version for Linux.
Diffstat (limited to 'src/TaskMan.cc')
-rw-r--r--src/TaskMan.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/TaskMan.cc b/src/TaskMan.cc
index fc33530..0fc4668 100644
--- a/src/TaskMan.cc
+++ b/src/TaskMan.cc
@@ -7,7 +7,12 @@ static Balau::DefaultTmpl<Balau::TaskMan> defaultTaskMan(50);
static Balau::LocalTmpl<Balau::TaskMan> localTaskMan;
Balau::TaskMan::TaskMan() : m_stopped(false), m_allowedToSignal(false) {
+#ifndef _WIN32
coro_create(&m_returnContext, 0, 0, 0, 0);
+#else
+ m_fiber = ConvertThreadToFiber(NULL);
+ Assert(m_fiber);
+#endif
if (!localTaskMan.getGlobal()) {
localTaskMan.setGlobal(this);
m_loop = ev_default_loop(EVFLAG_AUTO);