cblater-hold-lock-on-broadcast-20050411
authorTom Keiser <tkeiser@gmail.com>
Mon, 11 Apr 2005 19:10:58 +0000 (19:10 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 11 Apr 2005 19:10:58 +0000 (19:10 +0000)
avoid race from not holding lock around fsync_cond broadcast

src/viced/callback.c

index f5d2b91..c8344cb 100644 (file)
@@ -1408,7 +1408,9 @@ BreakVolumeCallBacksLater(afs_uint32 volume)
 
     ViceLog(25, ("Fsync thread wakeup\n"));
 #ifdef AFS_PTHREAD_ENV
+    FSYNC_LOCK;
     assert(pthread_cond_broadcast(&fsync_cond) == 0);
+    FSYNC_UNLOCK;
 #else
     LWP_NoYieldSignal(fsync_wait);
 #endif