SF: Cleanups to use std::atomic/std::mutex

A few places in the code used "volatile". This patch removes the
volatile.

In most of the cases, the volatile value was converted to a std::atomic
value. The exception was Barrier where it was not actually necessary,
but there I converted the code to use std::mutex.

Bug: None
Test: atest SurfaceFlinger_test CtsViewTestCases
Change-Id: I7b4f5a7398a241db8201dc7f60d7c9cd41e32e1b
diff --git a/services/surfaceflinger/BufferQueueLayer.h b/services/surfaceflinger/BufferQueueLayer.h
index 579ed81..400f412 100644
--- a/services/surfaceflinger/BufferQueueLayer.h
+++ b/services/surfaceflinger/BufferQueueLayer.h
@@ -137,8 +137,8 @@
     int mActiveBufferSlot;
 
     // thread-safe
-    volatile int32_t mQueuedFrames;
-    volatile int32_t mSidebandStreamChanged; // used like an atomic boolean
+    std::atomic<int32_t> mQueuedFrames{0};
+    std::atomic<bool> mSidebandStreamChanged{false};
 };
 
 } // namespace android