summaryrefslogtreecommitdiffstats
path: root/ui.h
diff options
context:
space:
mode:
authorJerry Zhang <zhangjerry@google.com>2018-05-22 01:04:57 +0200
committerJerry Zhang <zhangjerry@google.com>2018-05-30 00:20:58 +0200
commitb31f9ce6d150a264f584d9b38a54da0723fc249c (patch)
tree71b88a713e2aa47e6bdbb54748d14f3fa5d29d54 /ui.h
parentui: Use std::thread to create input/progress threads. (diff)
downloadandroid_bootable_recovery-b31f9ce6d150a264f584d9b38a54da0723fc249c.tar
android_bootable_recovery-b31f9ce6d150a264f584d9b38a54da0723fc249c.tar.gz
android_bootable_recovery-b31f9ce6d150a264f584d9b38a54da0723fc249c.tar.bz2
android_bootable_recovery-b31f9ce6d150a264f584d9b38a54da0723fc249c.tar.lz
android_bootable_recovery-b31f9ce6d150a264f584d9b38a54da0723fc249c.tar.xz
android_bootable_recovery-b31f9ce6d150a264f584d9b38a54da0723fc249c.tar.zst
android_bootable_recovery-b31f9ce6d150a264f584d9b38a54da0723fc249c.zip
Diffstat (limited to 'ui.h')
-rw-r--r--ui.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/ui.h b/ui.h
index 75390d83c..32e28099e 100644
--- a/ui.h
+++ b/ui.h
@@ -18,10 +18,11 @@
#define RECOVERY_UI_H
#include <linux/input.h> // KEY_MAX
-#include <pthread.h>
#include <atomic>
+#include <condition_variable>
#include <functional>
+#include <mutex>
#include <string>
#include <thread>
#include <vector>
@@ -188,8 +189,8 @@ class RecoveryUI {
bool InitScreensaver();
// Key event input queue
- pthread_mutex_t key_queue_mutex;
- pthread_cond_t key_queue_cond;
+ std::mutex key_queue_mutex;
+ std::condition_variable key_queue_cond;
int key_queue[256], key_queue_len;
char key_pressed[KEY_MAX + 1]; // under key_queue_mutex
int key_last_down; // under key_queue_mutex