30 #ifndef __BASE_FIBER_HH__ 31 #define __BASE_FIBER_HH__ 36 #if defined(__APPLE__) && defined(__MACH__) 37 #define _XOPEN_SOURCE 600 47 #include "config/have_valgrind.hh" 72 Fiber(
size_t stack_size=DefaultStackSize);
101 virtual void main() = 0;
118 unsigned valgrindStackId;
126 #endif // __BASE_FIBER_HH__ void run()
Start executing the fiber represented by this object.
bool finished() const
Returns whether the "main" function of this fiber has finished.
static void entryTrampoline()
static Fiber * primaryFiber()
Get a pointer to the primary Fiber.
static const size_t DefaultStackSize
This class represents a fiber, which is a light weight sort of thread which is cooperatively schedule...
bool started() const
Returns whether the "main" function of this fiber has started.
Fiber(size_t stack_size=DefaultStackSize)
stack_size is the size of the stack available to this fiber.
static Fiber * currentFiber()
Get a pointer to the current running Fiber.
virtual void main()=0
This method is called when this fiber is first run.