summaryrefslogtreecommitdiffstats
path: root/wear_ui.cpp
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 /wear_ui.cpp
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 'wear_ui.cpp')
-rw-r--r--wear_ui.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/wear_ui.cpp b/wear_ui.cpp
index f4a839923..65c4aeed6 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -16,7 +16,6 @@
#include "wear_ui.h"
-#include <pthread.h>
#include <string.h>
#include <string>
@@ -86,11 +85,10 @@ void WearRecoveryUI::SetStage(int /* current */, int /* max */) {}
void WearRecoveryUI::StartMenu(const std::vector<std::string>& headers,
const std::vector<std::string>& items, size_t initial_selection) {
- pthread_mutex_lock(&updateMutex);
+ std::lock_guard<std::mutex> lg(updateMutex);
if (text_rows_ > 0 && text_cols_ > 0) {
menu_ = std::make_unique<Menu>(scrollable_menu_, text_rows_ - kMenuUnusableRows - 1,
text_cols_ - 1, headers, items, initial_selection);
update_screen_locked();
}
- pthread_mutex_unlock(&updateMutex);
}