diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-02-05 19:13:16 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-06-18 22:29:15 +0200 |
commit | 8d0e3c542258cc50081af93aa85e0e3cbf8900c3 (patch) | |
tree | c63361e68b801183957ea9c614bad279aefc212c /src/common/fiber.h | |
parent | Common: Implement a basic Fiber class. (diff) | |
download | yuzu-8d0e3c542258cc50081af93aa85e0e3cbf8900c3.tar yuzu-8d0e3c542258cc50081af93aa85e0e3cbf8900c3.tar.gz yuzu-8d0e3c542258cc50081af93aa85e0e3cbf8900c3.tar.bz2 yuzu-8d0e3c542258cc50081af93aa85e0e3cbf8900c3.tar.lz yuzu-8d0e3c542258cc50081af93aa85e0e3cbf8900c3.tar.xz yuzu-8d0e3c542258cc50081af93aa85e0e3cbf8900c3.tar.zst yuzu-8d0e3c542258cc50081af93aa85e0e3cbf8900c3.zip |
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 @@ #include "common/common_types.h" #include "common/spin_lock.h" +#ifndef _MSC_VER +namespace boost::context::detail { + struct transfer_t; +} +#endif + namespace Common { class Fiber { @@ -31,9 +37,6 @@ public: /// Only call from main thread's fiber void Exit(); - /// Used internally but required to be public, Shall not be used - void _start(void* parameter); - /// Changes the start parameter of the fiber. Has no effect if the fiber already started void SetStartParameter(void* new_parameter) { start_parameter = new_parameter; @@ -42,6 +45,16 @@ public: private: Fiber(); +#ifdef _MSC_VER + void start(); + static void FiberStartFunc(void* fiber_parameter); +#else + void start(boost::context::detail::transfer_t& transfer); + static void FiberStartFunc(boost::context::detail::transfer_t transfer); +#endif + + + struct FiberImpl; SpinLock guard; |