From f5923f5ceafc627b8b457ead70d8ac296208bf76 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 20 Mar 2012 15:24:50 -0400 Subject: [PATCH] Check for mutex bugs. --- src/platform_posix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platform_posix.c b/src/platform_posix.c index f9909045..e82d6536 100644 --- a/src/platform_posix.c +++ b/src/platform_posix.c @@ -444,6 +444,8 @@ int __PHYSFS_platformGrabMutex(void *mutex) void __PHYSFS_platformReleaseMutex(void *mutex) { PthreadMutex *m = (PthreadMutex *) mutex; + assert(m->owner == pthread_self()); /* catch programming errors. */ + assert(m->count > 0); /* catch programming errors. */ if (m->owner == pthread_self()) { if (--m->count == 0)