]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-sleep-when-out-of-buffers-20061212
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 12 Dec 2006 17:02:37 +0000 (17:02 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 12 Dec 2006 17:02:37 +0000 (17:02 +0000)
When there are no free buffers, don't loop continuously.
Sleep so that the other threads that are holding the buffers
can grab the global buffer lock and release them.

src/WINNT/afsd/cm_buf.c

index e19ab0aae0dbac5e6112b94d1cd04386b5125a76..9b790e51fb444c3f1f0e0cf5f5ebcedac327b8ce 100644 (file)
@@ -862,6 +862,7 @@ long buf_GetNewLocked(struct cm_scache *scp, osi_hyper_t *offsetp, cm_buf_t **bu
             return 0;
         } /* for all buffers in lru queue */
         lock_ReleaseWrite(&buf_globalLock);
+               Sleep(100);             /* give some time for a buffer to be freed */
     }  /* while loop over everything */
     /* not reached */
 } /* the proc */