From e1bbd521d9c35957205046ca86dbfe1483bce251 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Thu, 10 Nov 2022 21:48:08 +0000 Subject: [PATCH] Fix potential circular queue submission race If a producer thread was waiting for the queue to have free space and the consumer thread hadn't yet acquired the production mutex a deadlock could occur --- app/src/main/cpp/skyline/common/circular_queue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/common/circular_queue.h b/app/src/main/cpp/skyline/common/circular_queue.h index 7644d30f..bdbd3836 100644 --- a/app/src/main/cpp/skyline/common/circular_queue.h +++ b/app/src/main/cpp/skyline/common/circular_queue.h @@ -57,7 +57,7 @@ namespace skyline { while (true) { if (start == end) { - std::unique_lock lock(productionMutex); + std::unique_lock lock{consumptionMutex}; TRACE_EVENT_END("containers"); preWait();