From ac3690f2057fb93ce18f156ff5ffd720a6d6f60c Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Sat, 24 Aug 2019 15:57:49 +0200 Subject: Input: UDP Client to provide motion and touch controls An implementation of the cemuhook motion/touch protocol, this adds the ability for users to connect several different devices to citra to send direct motion and touch data to citra. Co-Authored-By: jroweboy --- src/common/thread.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/common/thread.h') diff --git a/src/common/thread.h b/src/common/thread.h index 0cfd98be6..5584c3bf3 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -28,6 +28,15 @@ public: is_set = false; } + template + bool WaitFor(const std::chrono::duration& time) { + std::unique_lock lk(mutex); + if (!condvar.wait_for(lk, time, [this] { return is_set; })) + return false; + is_set = false; + return true; + } + template bool WaitUntil(const std::chrono::time_point& time) { std::unique_lock lk{mutex}; -- cgit v1.2.3