mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Use Common::Flag and Common::Event when possible
Replaces old and simple usages of std::atomic<bool> with Common::Flag (which was introduced after the initial usage), so it's clear that the variable is a flag and because Common::Flag is well tested. This also replaces the ready logic in WiimoteReal with Common::Event since it was basically just unnecessarily reimplementing Common::Event.
This commit is contained in:
@ -4,13 +4,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Flag.h"
|
||||
|
||||
struct EfbPokeData;
|
||||
|
||||
@ -70,7 +70,7 @@ public:
|
||||
|
||||
void PullEvents()
|
||||
{
|
||||
if (!m_empty.load())
|
||||
if (!m_empty.IsSet())
|
||||
PullEventsInternal();
|
||||
}
|
||||
void PushEvent(const Event& event, bool blocking = false);
|
||||
@ -84,7 +84,7 @@ private:
|
||||
|
||||
static AsyncRequests s_singleton;
|
||||
|
||||
std::atomic<bool> m_empty;
|
||||
Common::Flag m_empty;
|
||||
std::queue<Event> m_queue;
|
||||
std::mutex m_mutex;
|
||||
std::condition_variable m_cond;
|
||||
|
Reference in New Issue
Block a user