changeset 11852:0bbdbc75532f

Don't mutex_unlock if it was never locked. Patch by Min Sik Kim
author alex
date Sun, 25 Jan 2004 20:03:47 +0000
parents dcc8d9bb5739
children b5805b819ff9
files loader/win32.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/loader/win32.c	Sun Jan 25 19:19:30 2004 +0000
+++ b/loader/win32.c	Sun Jan 25 20:03:47 2004 +0000
@@ -1374,8 +1374,11 @@
 	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;
 }