diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/cpu_manager.h | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h index aee352245..f0751fc58 100644 --- a/src/core/cpu_manager.h +++ b/src/core/cpu_manager.h @@ -43,15 +43,17 @@ public: is_async_gpu = is_async; } + void OnGpuReady() { + gpu_barrier->Sync(); + } + void Initialize(); void Shutdown(); - void Pause(bool paused); - static std::function<void(void*)> GetGuestThreadStartFunc(); static std::function<void(void*)> GetIdleThreadStartFunc(); - static std::function<void(void*)> GetSuspendThreadStartFunc(); - void* GetStartFuncParamater(); + static std::function<void(void*)> GetShutdownThreadStartFunc(); + void* GetStartFuncParameter(); void PreemptSingleCore(bool from_running_enviroment = true); @@ -63,43 +65,34 @@ private: static void GuestThreadFunction(void* cpu_manager); static void GuestRewindFunction(void* cpu_manager); static void IdleThreadFunction(void* cpu_manager); - static void SuspendThreadFunction(void* cpu_manager); + static void ShutdownThreadFunction(void* cpu_manager); void MultiCoreRunGuestThread(); void MultiCoreRunGuestLoop(); void MultiCoreRunIdleThread(); - void MultiCoreRunSuspendThread(); - void MultiCorePause(bool paused); void SingleCoreRunGuestThread(); void SingleCoreRunGuestLoop(); void SingleCoreRunIdleThread(); - void SingleCoreRunSuspendThread(); - void SingleCorePause(bool paused); static void ThreadStart(std::stop_token stop_token, CpuManager& cpu_manager, std::size_t core); - void RunThread(std::stop_token stop_token, std::size_t core); + void ShutdownThread(); + void RunThread(std::size_t core); struct CoreData { std::shared_ptr<Common::Fiber> host_context; - std::unique_ptr<Common::Event> enter_barrier; - std::unique_ptr<Common::Event> exit_barrier; - std::atomic<bool> is_running; - std::atomic<bool> is_paused; - std::atomic<bool> initialized; std::jthread host_thread; }; - std::atomic<bool> running_mode{}; - std::atomic<bool> paused_state{}; - + std::unique_ptr<Common::Barrier> gpu_barrier{}; std::array<CoreData, Core::Hardware::NUM_CPU_CORES> core_data{}; bool is_async_gpu{}; bool is_multicore{}; std::atomic<std::size_t> current_core{}; std::size_t idle_count{}; + std::size_t num_cores{}; static constexpr std::size_t max_cycle_runs = 5; System& system; |