pthread-glock-volatility-20050921
[openafs.git] / src / util / pthread_glock.h
index fa8eecc..1c9beea 100644 (file)
 
 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)
 #ifndef AFS_GRMUTEX_DECLSPEC
-#define AFS_GRMUTEX_DECLSPEC __declspec(dllimport) extern 
+#define AFS_GRMUTEX_DECLSPEC __declspec(dllimport) extern
 #endif
 #else
 #define AFS_GRMUTEX_DECLSPEC extern
@@ -35,10 +35,10 @@ extern int pthread_recursive_mutex_lock(pthread_recursive_mutex_p);
 extern int pthread_recursive_mutex_unlock(pthread_recursive_mutex_p);
 
 #define LOCK_GLOBAL_MUTEX \
-    assert(pthread_recursive_mutex_lock(&grmutex)==0);
+    assert(pthread_recursive_mutex_lock(&grmutex)==0)
 
 #define UNLOCK_GLOBAL_MUTEX \
-    assert(pthread_recursive_mutex_unlock(&grmutex)==0);
+    assert(pthread_recursive_mutex_unlock(&grmutex)==0)
 
 #else