Don't mutex_unlock if it was never locked. Patch by Min Sik Kim

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11853 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2004-01-25 20:03:47 +00:00
parent 0daaf45c2c
commit ca02bdcc20
1 changed files with 5 additions and 2 deletions

View File

@ -1374,8 +1374,11 @@ static void WINAPI expLeaveCriticalSection(CRITICAL_SECTION* c)
printf("Win32 Warning: Leaving uninitialized Critical Section %p!!\n", c);
return;
}
cs->locked=0;
pthread_mutex_unlock(&(cs->mutex));
if (cs->locked)
{
cs->locked=0;
pthread_mutex_unlock(&(cs->mutex));
}
return;
}