Add a new mutex in CommandQueue to protect Vulkan Command Pool Before this change, the CommandQueue::mMutex protects both: 1. Members of CommandQueue class, e.g. mInFlightCommands. 2. Operations on the same command pool and command buffers allocated from the same command pool. If one thread accesses resources 1, the other thread is doing operations in 2, they could be blocked by each other. For example, if thread 1 calls eglClientWaitSync() to check if certain commands finish execution (accessed resources in 1.), while thread 2 calls eglMakeCurrent() to flush commands (issue operations in 2.), thread 1 could be blocked by thread 2. This is against the egl spec where eglClientWaitSync() should return immediately when timeout passed to the call is 0. To fix the problem, this change creates a new class CommandPoolAccess that wraps operations in 2, and protects command pool and command buffer operations with a new mutex mCmdPoolMutex. With this new mutex, thread 1 and thread 2 would take different locks and not blocked by each other. Bug: b/362604439 Change-Id: Iccf0ae65809ccb0f593c5e318fde03e89e0c0fa3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6020895 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>