[Mplayer-cvslog] CVS: main/loader win32.c,1.83,1.84

Alex Beregszaszi alex at mplayerhq.hu
Sun Jan 25 21:29:33 CET 2004


Update of /cvsroot/mplayer/main/loader
In directory mail:/tmp/cvs-serv30745

Modified Files:
	win32.c 
Log Message:
reviewed the locking codes, a mutex should be unlocked before destroying it

Index: win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/win32.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- win32.c	25 Jan 2004 20:03:47 -0000	1.83
+++ win32.c	25 Jan 2004 20:29:31 -0000	1.84
@@ -1379,6 +1379,8 @@
 	cs->locked=0;
 	pthread_mutex_unlock(&(cs->mutex));
     }
+    else
+	printf("Win32 Warning: Unlocking unlocked Critical Section %p!!\n", c);
     return;
 }
 
@@ -1394,6 +1396,18 @@
     //    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




More information about the MPlayer-cvslog mailing list