summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2002-06-26 16:09:30 +0000
committerMarcus Brinkmann <marcus@gnu.org>2002-06-26 16:09:30 +0000
commit3556ae180ca253e447cbc1f0caf92ef65681e1aa (patch)
treee35e39646b92772dc20df3c429ab25ff2b2313fe
parentf8a257a68aa9422c4a5288ade4f171bcfef08509 (diff)
2002-06-26 Marcus Brinkmann <marcus@gnu.org>
* lock-acquire.c (fshelp_acquire_lock): Also wait for exclusive locks which might have been acquired while we were waiting for shared locks to finish.
-rw-r--r--libfshelp/ChangeLog6
-rw-r--r--libfshelp/lock-acquire.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/libfshelp/ChangeLog b/libfshelp/ChangeLog
index be35c65b..81323fe7 100644
--- a/libfshelp/ChangeLog
+++ b/libfshelp/ChangeLog
@@ -1,3 +1,9 @@
+2002-06-26 Marcus Brinkmann <marcus@gnu.org>
+
+ * lock-acquire.c (fshelp_acquire_lock): Also wait for exclusive
+ locks which might have been acquired while we were waiting for
+ shared locks to finish.
+
2002-06-07 Roland McGrath <roland@frob.com>
* fshelp.h: Use io_statbuf_t in place of struct stat throughout.
diff --git a/libfshelp/lock-acquire.c b/libfshelp/lock-acquire.c
index 3d8df550..bad1114d 100644
--- a/libfshelp/lock-acquire.c
+++ b/libfshelp/lock-acquire.c
@@ -111,8 +111,8 @@ fshelp_acquire_lock (struct lock_box *box, int *user, struct mutex *mut,
}
else if (flags & LOCK_EX)
{
- /* Wait for any shared locks to finish. */
- while (box->type == LOCK_SH)
+ /* Wait for any shared (and exclusive) locks to finish. */
+ while (box->type != LOCK_UN)
{
if (flags & LOCK_NB)
return EWOULDBLOCK;