Check for mutex bugs.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 20 Mar 2012 15:24:50 -0400
changeset 1238 97d4522cdf02
parent 1237 6d8b32355a28
child 1239 a96d88b357bc
Check for mutex bugs.
src/platform_posix.c
--- a/src/platform_posix.c	Mon Mar 19 21:01:51 2012 -0400
+++ b/src/platform_posix.c	Tue Mar 20 15:24:50 2012 -0400
@@ -444,6 +444,8 @@
 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)