$NetBSD: patch-ab,v 1.1.1.1 2004/01/26 12:06:43 jmmv Exp $

--- loader/win32.c.orig	2003-09-06 00:08:23.000000000 +0200
+++ loader/win32.c	2004-01-24 15:39:14.000000000 +0100
@@ -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;
 }
 
