Assert non-recursive usage of mutexes

This commit is contained in:
Romain Vimont 2021-02-01 22:20:02 +01:00
parent a9582b1d43
commit 2a3c6b64dd

View File

@ -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) {