Nebula
Loading...
Searching...
No Matches
fiber.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
9//------------------------------------------------------------------------------
10namespace Fibers
11{
12
13class Fiber
14{
15public:
16
18 Fiber();
20 Fiber(std::nullptr_t);
22 Fiber(void(*Function)(void*), void* context);
24 Fiber(const Fiber& rhs);
26 ~Fiber();
28 void operator=(const Fiber& rhs);
29
31 static void ThreadToFiber(Fiber& fiber);
33 static void FiberToThread(Fiber& fiber);
34
36 void SwitchToFiber(Fiber& CurrentFiber);
37private:
38 void* handle;
39 void* context;
40
41};
42
43} // namespace Fibers
Definition fiber.h:14
static void ThreadToFiber(Fiber &fiber)
convert thread to fiber
Definition posixfiber.cc:134
void * handle
Definition fiber.h:38
~Fiber()
destructor
Definition posixfiber.cc:104
void SwitchToFiber(Fiber &CurrentFiber)
switch to this fiber
Definition posixfiber.cc:155
Fiber()
constructor
Definition posixfiber.cc:33
void * context
Definition fiber.h:39
static void FiberToThread(Fiber &fiber)
convert fiber back to thread
Definition posixfiber.cc:144
void operator=(const Fiber &rhs)
assignment operator
Definition posixfiber.cc:119
Fiber implementation header.
Definition fiber.h:11