summaryrefslogtreecommitdiff
path: root/src/core/cpu_manager.h
diff options
context:
space:
mode:
authorGravatar liamwhite2022-07-05 18:20:39 -0400
committerGravatar GitHub2022-07-05 18:20:39 -0400
commit07e3c56f0de7a1567b1ae443abb64b767a31ed8c (patch)
tree3bd7d56181d79c69988d3f6d1310d9137cbb482f /src/core/cpu_manager.h
parentMerge pull request #8477 from Docteh/less_global (diff)
parentcommon/fiber: make fibers easier to use (diff)
downloadyuzu-07e3c56f0de7a1567b1ae443abb64b767a31ed8c.tar.gz
yuzu-07e3c56f0de7a1567b1ae443abb64b767a31ed8c.tar.xz
yuzu-07e3c56f0de7a1567b1ae443abb64b767a31ed8c.zip
Merge pull request #8532 from liamwhite/fiber-supplements
common/fiber: make fibers easier to use
Diffstat (limited to 'src/core/cpu_manager.h')
-rw-r--r--src/core/cpu_manager.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h
index f0751fc58..76dc58ee1 100644
--- a/src/core/cpu_manager.h
+++ b/src/core/cpu_manager.h
@@ -50,10 +50,15 @@ public:
50 void Initialize(); 50 void Initialize();
51 void Shutdown(); 51 void Shutdown();
52 52
53 static std::function<void(void*)> GetGuestThreadStartFunc(); 53 std::function<void()> GetGuestThreadStartFunc() {
54 static std::function<void(void*)> GetIdleThreadStartFunc(); 54 return [this] { GuestThreadFunction(); };
55 static std::function<void(void*)> GetShutdownThreadStartFunc(); 55 }
56 void* GetStartFuncParameter(); 56 std::function<void()> GetIdleThreadStartFunc() {
57 return [this] { IdleThreadFunction(); };
58 }
59 std::function<void()> GetShutdownThreadStartFunc() {
60 return [this] { ShutdownThreadFunction(); };
61 }
57 62
58 void PreemptSingleCore(bool from_running_enviroment = true); 63 void PreemptSingleCore(bool from_running_enviroment = true);
59 64
@@ -62,10 +67,10 @@ public:
62 } 67 }
63 68
64private: 69private:
65 static void GuestThreadFunction(void* cpu_manager); 70 void GuestThreadFunction();
66 static void GuestRewindFunction(void* cpu_manager); 71 void GuestRewindFunction();
67 static void IdleThreadFunction(void* cpu_manager); 72 void IdleThreadFunction();
68 static void ShutdownThreadFunction(void* cpu_manager); 73 void ShutdownThreadFunction();
69 74
70 void MultiCoreRunGuestThread(); 75 void MultiCoreRunGuestThread();
71 void MultiCoreRunGuestLoop(); 76 void MultiCoreRunGuestLoop();