Rewrite NetPlayClient input wait logic to use std::condition_variable's

Instead of sleeping in NetPlayClient::GetNetPads and NetPlayClient::WiimoteUpdate,
now use std::condition_variable. This allows for finer control over these blocking
areas.
This commit is contained in:
Aestek 2016-07-25 00:40:15 +02:00
commit 1760b3bdad
2 changed files with 39 additions and 14 deletions

View file

@ -14,6 +14,7 @@
#include <thread>
#include <vector>
#include "Common/CommonTypes.h"
#include "Common/Event.h"
#include "Common/FifoQueue.h"
#include "Common/TraversalClient.h"
#include "Core/NetPlayProto.h"
@ -175,6 +176,8 @@ private:
TraversalClient* m_traversal_client = nullptr;
std::thread m_MD5_thread;
bool m_should_compute_MD5 = false;
Common::Event m_gc_pad_event;
Common::Event m_wii_pad_event;
u32 m_timebase_frame = 0;
};