summaryrefslogtreecommitdiff
path: root/src/common/thread.h
diff options
context:
space:
mode:
authorGravatar fearlessTobi2019-08-24 15:57:49 +0200
committerGravatar FearlessTobi2020-01-23 20:55:26 +0100
commitac3690f2057fb93ce18f156ff5ffd720a6d6f60c (patch)
treed0ec80a2537b992146d34f5bf17ba0cc549bd88e /src/common/thread.h
parentMerge pull request #3341 from bunnei/time-posix-myrule (diff)
downloadyuzu-ac3690f2057fb93ce18f156ff5ffd720a6d6f60c.tar.gz
yuzu-ac3690f2057fb93ce18f156ff5ffd720a6d6f60c.tar.xz
yuzu-ac3690f2057fb93ce18f156ff5ffd720a6d6f60c.zip
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 <jroweboy@gmail.com>
Diffstat (limited to 'src/common/thread.h')
-rw-r--r--src/common/thread.h9
1 files changed, 9 insertions, 0 deletions
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:
28 is_set = false; 28 is_set = false;
29 } 29 }
30 30
31 template <class Duration>
32 bool WaitFor(const std::chrono::duration<Duration>& time) {
33 std::unique_lock<std::mutex> lk(mutex);
34 if (!condvar.wait_for(lk, time, [this] { return is_set; }))
35 return false;
36 is_set = false;
37 return true;
38 }
39
31 template <class Clock, class Duration> 40 template <class Clock, class Duration>
32 bool WaitUntil(const std::chrono::time_point<Clock, Duration>& time) { 41 bool WaitUntil(const std::chrono::time_point<Clock, Duration>& time) {
33 std::unique_lock lk{mutex}; 42 std::unique_lock lk{mutex};