Well after looking at bit more at the code, it seems like the real reason for the session_mutex unlock in the completion is to avoid holding a lock when invoking IPC callbacks.
Since Surface::swap_buffers may execute the completion within, we need to detect such condition and only unlock the session_mutex then instead of using a binary semaphore.
Well after looking at bit more at the code, it seems like the real reason for the session_mutex unlock in the completion is to avoid holding a lock when invoking IPC callbacks.
Since Surface: :swap_buffers may execute the completion within, we need to detect such condition and only unlock the session_mutex then instead of using a binary semaphore.