Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d90e5399 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix concurrent access bug in VrFlinger." into oc-dr1-dev

parents 222b7600 e36f1e4b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -248,11 +248,12 @@ void ApplicationDisplaySurface::OnQueueEvent(
           "ApplicationDisplaySurface::OnQueueEvent: queue_id=%d events=%x",
           consumer_queue->id(), events);

  std::lock_guard<std::mutex> autolock(lock_);

  // Always give the queue a chance to handle its internal bookkeeping.
  consumer_queue->HandleQueueEvents();

  // Check for hangup and remove a queue that is no longer needed.
  std::lock_guard<std::mutex> autolock(lock_);
  if (consumer_queue->hung_up()) {
    ALOGD_IF(TRACE, "ApplicationDisplaySurface::OnQueueEvent: Removing queue.");
    UnregisterQueue(consumer_queue);
@@ -317,11 +318,12 @@ void DirectDisplaySurface::OnQueueEvent(
  ALOGD_IF(TRACE, "DirectDisplaySurface::OnQueueEvent: queue_id=%d events=%x",
           consumer_queue->id(), events);

  std::lock_guard<std::mutex> autolock(lock_);

  // Always give the queue a chance to handle its internal bookkeeping.
  consumer_queue->HandleQueueEvents();

  // Check for hangup and remove a queue that is no longer needed.
  std::lock_guard<std::mutex> autolock(lock_);
  if (consumer_queue->hung_up()) {
    ALOGD_IF(TRACE, "DirectDisplaySurface::OnQueueEvent: Removing queue.");
    UnregisterQueue(consumer_queue);