Fix deadlocks when PostWorker thread tries to acquire lock.

There's some code paths where one thread waits for the post worker
thread while holding m_lock, and post worker will try to acquire the
lock. This scenario will deadlock, so let's remove those locks from
PostWorker thread.

Bug: 273986739
Test: emulator e2e tests
Change-Id: I97cf7908a2e9314e6c7cd58a95db7ee9bc5a64da
diff --git a/stream-servers/FrameBuffer.cpp b/stream-servers/FrameBuffer.cpp
index 7e7456a..2ce61b6 100644
--- a/stream-servers/FrameBuffer.cpp
+++ b/stream-servers/FrameBuffer.cpp
@@ -3702,11 +3702,6 @@
 }
 
 bool FrameBuffer::flushColorBufferFromGl(HandleType colorBufferHandle) {
-    AutoLock mutex(m_lock);
-    return flushColorBufferFromGlLocked(colorBufferHandle);
-}
-
-bool FrameBuffer::flushColorBufferFromGlLocked(HandleType colorBufferHandle) {
     auto colorBuffer = findColorBuffer(colorBufferHandle);
     if (!colorBuffer) {
         ERR("Failed to find ColorBuffer:%d", colorBufferHandle);
@@ -3716,8 +3711,6 @@
 }
 
 bool FrameBuffer::flushColorBufferFromVk(HandleType colorBufferHandle) {
-    AutoLock mutex(m_lock);
-
     auto colorBuffer = findColorBuffer(colorBufferHandle);
     if (!colorBuffer) {
         ERR("Failed to find ColorBuffer:%d", colorBufferHandle);
@@ -3727,8 +3720,6 @@
 }
 
 bool FrameBuffer::flushColorBufferFromVkBytes(HandleType colorBufferHandle, const void* bytes, size_t bytesSize) {
-    AutoLock mutex(m_lock);
-
     auto colorBuffer = findColorBuffer(colorBufferHandle);
     if (!colorBuffer) {
         ERR("Failed to find ColorBuffer:%d", colorBufferHandle);
@@ -3738,8 +3729,6 @@
 }
 
 bool FrameBuffer::invalidateColorBufferForGl(HandleType colorBufferHandle) {
-    AutoLock mutex(m_lock);
-
     auto colorBuffer = findColorBuffer(colorBufferHandle);
     if (!colorBuffer) {
         ERR("Failed to find ColorBuffer:%d", colorBufferHandle);
@@ -3749,8 +3738,6 @@
 }
 
 bool FrameBuffer::invalidateColorBufferForVk(HandleType colorBufferHandle) {
-    AutoLock mutex(m_lock);
-
     auto colorBuffer = findColorBuffer(colorBufferHandle);
     if (!colorBuffer) {
         ERR("Failed to find ColorBuffer:%d", colorBufferHandle);