diff options
Diffstat (limited to 'src/common/fiber.h')
| -rw-r--r-- | src/common/fiber.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/common/fiber.h b/src/common/fiber.h index ab44905cf..812d6644a 100644 --- a/src/common/fiber.h +++ b/src/common/fiber.h | |||
| @@ -10,6 +10,12 @@ | |||
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "common/spin_lock.h" | 11 | #include "common/spin_lock.h" |
| 12 | 12 | ||
| 13 | #ifndef _MSC_VER | ||
| 14 | namespace boost::context::detail { | ||
| 15 | struct transfer_t; | ||
| 16 | } | ||
| 17 | #endif | ||
| 18 | |||
| 13 | namespace Common { | 19 | namespace Common { |
| 14 | 20 | ||
| 15 | class Fiber { | 21 | class Fiber { |
| @@ -31,9 +37,6 @@ public: | |||
| 31 | /// Only call from main thread's fiber | 37 | /// Only call from main thread's fiber |
| 32 | void Exit(); | 38 | void Exit(); |
| 33 | 39 | ||
| 34 | /// Used internally but required to be public, Shall not be used | ||
| 35 | void _start(void* parameter); | ||
| 36 | |||
| 37 | /// Changes the start parameter of the fiber. Has no effect if the fiber already started | 40 | /// Changes the start parameter of the fiber. Has no effect if the fiber already started |
| 38 | void SetStartParameter(void* new_parameter) { | 41 | void SetStartParameter(void* new_parameter) { |
| 39 | start_parameter = new_parameter; | 42 | start_parameter = new_parameter; |
| @@ -42,6 +45,16 @@ public: | |||
| 42 | private: | 45 | private: |
| 43 | Fiber(); | 46 | Fiber(); |
| 44 | 47 | ||
| 48 | #ifdef _MSC_VER | ||
| 49 | void start(); | ||
| 50 | static void FiberStartFunc(void* fiber_parameter); | ||
| 51 | #else | ||
| 52 | void start(boost::context::detail::transfer_t& transfer); | ||
| 53 | static void FiberStartFunc(boost::context::detail::transfer_t transfer); | ||
| 54 | #endif | ||
| 55 | |||
| 56 | |||
| 57 | |||
| 45 | struct FiberImpl; | 58 | struct FiberImpl; |
| 46 | 59 | ||
| 47 | SpinLock guard; | 60 | SpinLock guard; |