pthread-glock-volatility-20050921
authorPeter Somogyi <psomogyi@gamax.hu>
Wed, 21 Sep 2005 16:13:28 +0000 (16:13 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 21 Sep 2005 16:13:28 +0000 (16:13 +0000)
FIXES 21526

deal with situations where pthread glock assert happens by asserting volatility. ick.

src/util/pthread_glock.c
src/util/pthread_glock.h

index eec4a06..e6e6f78 100644 (file)
@@ -26,7 +26,7 @@ RCSID
 
 pthread_recursive_mutex_t grmutex;
 
-static int glock_init;
+static int glock_init = 0;
 static pthread_once_t glock_init_once = PTHREAD_ONCE_INIT;
 
 static void
index da6aefd..1c9beea 100644 (file)
@@ -16,9 +16,9 @@
 
 typedef struct {
     pthread_mutex_t mut;
-    pthread_t owner;
-    unsigned int locked;
-    unsigned int times_inside;
+    volatile pthread_t owner;
+    volatile unsigned int locked;
+    volatile unsigned int times_inside;
 } pthread_recursive_mutex_t, *pthread_recursive_mutex_p;
 
 #if defined(AFS_NT40_ENV) && defined(AFS_PTHREAD_ENV)