acquire-fsync-lock-inside-while-loop-20040202
authorTom Maher <tmaher@watson.org>
Tue, 3 Feb 2004 04:53:43 +0000 (04:53 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 3 Feb 2004 04:53:43 +0000 (04:53 +0000)
FIXES 3205

in order to not violate the invariant that pthread_cond_timedwait be called
with a locked mutex, we must relock if we unlock.

src/viced/viced.c

index 5690321..68b76bd 100644 (file)
@@ -482,8 +482,8 @@ FsyncCheckLWP()
     assert(pthread_mutex_init(&fsync_glock_mutex, NULL) == 0);
 #endif
 
-    FSYNC_LOCK;
     while (1) {
+       FSYNC_LOCK;
 #ifdef AFS_PTHREAD_ENV
        /* rounding is fine */
        fsync_next.tv_nsec = 0;