diff options
author | Sean Paul <seanpaul@chromium.org> | 2017-04-25 21:11:46 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-04-25 21:11:46 +0000 |
commit | 8035e239065d0d8c9059fb4d35108951a8c8dc9b (patch) | |
tree | ff0b48688cb02274f335fb6c763ee8f00ea273ce | |
parent | 09db4a4721840702d3db81b2dcfb0f09bb046909 (diff) | |
parent | 8f88825edbe3cdae01df6bb5483984ba9672fbfc (diff) | |
download | drm_hwcomposer-8035e239065d0d8c9059fb4d35108951a8c8dc9b.tar.gz |
resolve merge conflicts of 5903f9a to oc-dev-plus-aosp
am: 8f88825edb
Change-Id: I850cceff0848aad6648bc804c982a1751d196caa
-rw-r--r-- | drmhwctwo.cpp | 6 | ||||
-rw-r--r-- | worker.cpp | 9 |
2 files changed, 5 insertions, 10 deletions
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp index 138f5fa..b13fce1 100644 --- a/drmhwctwo.cpp +++ b/drmhwctwo.cpp @@ -236,11 +236,7 @@ HWC2::Error DrmHwcTwo::HwcDisplay::RegisterVsyncCallback( hwc2_callback_data_t data, hwc2_function_pointer_t func) { supported(__func__); auto callback = std::make_shared<DrmVsyncCallback>(data, func); - int ret = vsync_worker_.RegisterCallback(std::move(callback)); - if (ret) { - ALOGE("Failed to register callback d=%" PRIu64 " ret=%d", handle_, ret); - return HWC2::Error::BadDisplay; - } + vsync_worker_.RegisterCallback(std::move(callback)); return HWC2::Error::None; } @@ -30,7 +30,6 @@ Worker::~Worker() { } int Worker::InitWorker() { - std::lock_guard<std::mutex> lk(mutex_); if (initialized()) return -EALREADY; @@ -43,10 +42,10 @@ int Worker::InitWorker() { } void Worker::Exit() { - std::unique_lock<std::mutex> lk(mutex_); - exit_ = true; if (initialized()) { - lk.unlock(); + Lock(); + exit_ = true; + Unlock(); cond_.notify_all(); thread_->join(); initialized_ = false; @@ -70,7 +69,7 @@ int Worker::WaitForSignalOrExitLocked(int64_t max_nanoseconds) { if (should_exit()) ret = -EINTR; - // release leaves mutex locked when going out of scope + // release leaves lock unlocked when returning lk.release(); return ret; |