diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-01-25 20:29:31 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-01-25 20:29:31 +0000 |
commit | edfe08ef4efe3a08fd424684c2cafb27fbb6808f (patch) | |
tree | 575f3cf76d78a9f82e7666a740f0a95bce60ede7 /loader | |
parent | ca02bdcc20b6784b6dcba180df286a40355c3b19 (diff) | |
download | mpv-edfe08ef4efe3a08fd424684c2cafb27fbb6808f.tar.bz2 mpv-edfe08ef4efe3a08fd424684c2cafb27fbb6808f.tar.xz |
reviewed the locking codes, a mutex should be unlocked before destroying it
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11854 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader')
-rw-r--r-- | loader/win32.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/loader/win32.c b/loader/win32.c index 6627789362..35d38b72f0 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -1379,6 +1379,8 @@ static void WINAPI expLeaveCriticalSection(CRITICAL_SECTION* c) cs->locked=0; pthread_mutex_unlock(&(cs->mutex)); } + else + printf("Win32 Warning: Unlocking unlocked Critical Section %p!!\n", c); return; } @@ -1394,6 +1396,18 @@ static void WINAPI expDeleteCriticalSection(CRITICAL_SECTION *c) // struct CRITSECT* cs=(struct CRITSECT*)c; dbgprintf("DeleteCriticalSection(0x%x)\n",c); + if (!cs) + { + printf("Win32 Warning: Deleting uninitialized Critical Section %p!!\n", c); + return; + } + + if (cs->locked) + { + printf("Win32 Warning: Deleting unlocked Critical Section %p!!\n", c); + pthread_mutex_unlock(&(cs->mutex)); + } + #ifndef GARBAGE pthread_mutex_destroy(&(cs->mutex)); // released by GarbageCollector in my_relase otherwise |