Skip to content

Commit

Permalink
Check for mutex bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 20, 2012
1 parent e34e67f commit f5923f5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/platform_posix.c
Expand Up @@ -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)
Expand Down

0 comments on commit f5923f5

Please sign in to comment.