resolve merge conflicts of 5903f9a to oc-dev-plus-aosp

Change-Id: Ifaba5b61db97ad44c15775b9ddfd60f26e9210f3
Test: I solemnly swear I built this conflict resolution.
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp
index 138f5fa..b13fce1 100644
--- a/drmhwctwo.cpp
+++ b/drmhwctwo.cpp
@@ -236,11 +236,7 @@
     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;
 }
 
diff --git a/worker.cpp b/worker.cpp
index da6c580..66ebab3 100644
--- a/worker.cpp
+++ b/worker.cpp
@@ -30,7 +30,6 @@
 }
 
 int Worker::InitWorker() {
-  std::lock_guard<std::mutex> lk(mutex_);
   if (initialized())
     return -EALREADY;
 
@@ -43,10 +42,10 @@
 }
 
 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 @@
   if (should_exit())
     ret = -EINTR;
 
-  // release leaves mutex locked when going out of scope
+  // release leaves lock unlocked when returning
   lk.release();
 
   return ret;