summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2023-06-13 11:47:20 +0200
committerGitHub <noreply@github.com>2023-06-13 11:47:20 +0200
commit6d16a0970739bfa28bafa7a17e6aea63333c2580 (patch)
tree5a8660f9a501803cc4986ab55d75e3f1e64fcd95 /Source/Core
parent74c0519c54414e26ea83a849a7b863bec92d4550 (diff)
parent3c80f821c0ad4745b754a2afe3896855c3a9e3ad (diff)
Merge pull request #11941 from Dentomologist/convert_blockingloop_stopmode_to_enum_class
Common: Convert BlockingLoop::StopMode to enum class
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/BlockingLoop.h18
-rw-r--r--Source/Core/VideoCommon/Fifo.cpp2
2 files changed, 10 insertions, 10 deletions
diff --git a/Source/Core/Common/BlockingLoop.h b/Source/Core/Common/BlockingLoop.h
index 4e4094da53..472a84b1f6 100644
--- a/Source/Core/Common/BlockingLoop.h
+++ b/Source/Core/Common/BlockingLoop.h
@@ -21,15 +21,15 @@ namespace Common
class BlockingLoop
{
public:
- enum StopMode
+ enum class StopMode
{
- kNonBlock,
- kBlock,
- kBlockAndGiveUp,
+ NonBlock,
+ Block,
+ BlockAndGiveUp,
};
BlockingLoop() { m_stopped.Set(); }
- ~BlockingLoop() { Stop(kBlockAndGiveUp); }
+ ~BlockingLoop() { Stop(StopMode::BlockAndGiveUp); }
// Triggers to rerun the payload of the Run() function at least once again.
// This function will never block and is designed to finish as fast as possible.
void Wakeup()
@@ -200,7 +200,7 @@ public:
// Quits the main loop.
// By default, it will wait until the main loop quits.
// Be careful to not use the blocking way within the payload of the Run() method.
- void Stop(StopMode mode = kBlock)
+ void Stop(StopMode mode = StopMode::Block)
{
if (m_stopped.IsSet())
return;
@@ -212,12 +212,12 @@ public:
switch (mode)
{
- case kNonBlock:
+ case StopMode::NonBlock:
break;
- case kBlock:
+ case StopMode::Block:
Wait();
break;
- case kBlockAndGiveUp:
+ case StopMode::BlockAndGiveUp:
WaitYield(std::chrono::milliseconds(100), [&] {
// If timed out, assume no one will come along to call Run, so force a break
m_stopped.Set();
diff --git a/Source/Core/VideoCommon/Fifo.cpp b/Source/Core/VideoCommon/Fifo.cpp
index cf5327ecd3..3e6a6dd2ec 100644
--- a/Source/Core/VideoCommon/Fifo.cpp
+++ b/Source/Core/VideoCommon/Fifo.cpp
@@ -131,7 +131,7 @@ void FifoManager::ExitGpuLoop(Core::System& system)
// Terminate GPU thread loop
m_emu_running_state.Set();
- m_gpu_mainloop.Stop(m_gpu_mainloop.kNonBlock);
+ m_gpu_mainloop.Stop(Common::BlockingLoop::StopMode::NonBlock);
}
void FifoManager::EmulatorState(bool running)