summaryrefslogtreecommitdiff
path: root/src/common/fiber.h
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2020-02-05 14:13:16 -0400
committerGravatar Fernando Sahmkow2020-06-18 16:29:15 -0400
commit8d0e3c542258cc50081af93aa85e0e3cbf8900c3 (patch)
treec63361e68b801183957ea9c614bad279aefc212c /src/common/fiber.h
parentCommon: Implement a basic Fiber class. (diff)
downloadyuzu-8d0e3c542258cc50081af93aa85e0e3cbf8900c3.tar.gz
yuzu-8d0e3c542258cc50081af93aa85e0e3cbf8900c3.tar.xz
yuzu-8d0e3c542258cc50081af93aa85e0e3cbf8900c3.zip
Tests: Add tests for fibers and refactor/fix Fiber class
Diffstat (limited to 'src/common/fiber.h')
-rw-r--r--src/common/fiber.h19
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
14namespace boost::context::detail {
15 struct transfer_t;
16}
17#endif
18
13namespace Common { 19namespace Common {
14 20
15class Fiber { 21class 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:
42private: 45private:
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;