From 2a3c6b64ddca53c293b143a40a8ff858546673fd Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Mon, 1 Feb 2021 22:20:02 +0100 Subject: [PATCH] Assert non-recursive usage of mutexes --- app/src/util/thread.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/util/thread.c b/app/src/util/thread.c index fa774cfe..4471da3b 100644 --- a/app/src/util/thread.c +++ b/app/src/util/thread.c @@ -43,6 +43,8 @@ sc_mutex_destroy(sc_mutex *mutex) { void sc_mutex_lock(sc_mutex *mutex) { + // SDL mutexes are recursive, but we don't want to use recursive mutexes + assert(!sc_mutex_held(mutex)); int r = SDL_LockMutex(mutex->mutex); #ifndef NDEBUG if (r) {