aboutsummaryrefslogtreecommitdiff
path: root/src/common/thread.h
diff options
context:
space:
mode:
authorfearlessTobi <thm.frey@gmail.com>2019-08-24 15:57:49 +0200
committerFearlessTobi <thm.frey@gmail.com>2020-01-23 20:55:26 +0100
commitac3690f2057fb93ce18f156ff5ffd720a6d6f60c (patch)
treed0ec80a2537b992146d34f5bf17ba0cc549bd88e /src/common/thread.h
parenta167da4278df6d864a8990f846cf3ede1158f3db (diff)
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 0cfd98be6c..5584c3bf36 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -28,6 +28,15 @@ public:
is_set = false;
}
+ template <class Duration>
+ bool WaitFor(const std::chrono::duration<Duration>& time) {
+ std::unique_lock<std::mutex> lk(mutex);
+ if (!condvar.wait_for(lk, time, [this] { return is_set; }))
+ return false;
+ is_set = false;
+ return true;
+ }
+
template <class Clock, class Duration>
bool WaitUntil(const std::chrono::time_point<Clock, Duration>& time) {
std::unique_lock lk{mutex};