diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-02-11 18:55:36 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-02-11 18:55:36 +0000 |
commit | 3139e2fd3f00225ac02821ea8895758740af4556 (patch) | |
tree | be2caaa8d9831f7730a8fd7a6f9a46c65a95debe /libfshelp/lock-acquire.c | |
parent | e8121a05d1543c756918ea9531488c7480d723b7 (diff) | |
download | hurd-3139e2fd3f00225ac02821ea8895758740af4556.tar.gz hurd-3139e2fd3f00225ac02821ea8895758740af4556.tar.bz2 hurd-3139e2fd3f00225ac02821ea8895758740af4556.zip |
entered into RCS
Diffstat (limited to 'libfshelp/lock-acquire.c')
-rw-r--r-- | libfshelp/lock-acquire.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libfshelp/lock-acquire.c b/libfshelp/lock-acquire.c index 0c1bb788..f8ddb7a6 100644 --- a/libfshelp/lock-acquire.c +++ b/libfshelp/lock-acquire.c @@ -19,7 +19,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Written by Michael I. Bushnell. */ -#include "fshelp.h" +#include "locks.h" error_t fshelp_acquire_lock (struct lock_box *box, int *user, struct mutex *mut, @@ -46,12 +46,12 @@ fshelp_acquire_lock (struct lock_box *box, int *user, struct mutex *mut, if (*user == LOCK_SH) { if (!--box->shcount) - box->lock_type == LOCK_UN; + box->type = LOCK_UN; } else if (*user == LOCK_EX) - box->lock_type == LOCK_UN; + box->type = LOCK_UN; - if (box->lock_type == LOCK_UN && box->waiting) + if (box->type == LOCK_UN && box->waiting) { box->waiting = 0; condition_broadcast (&box->wait); @@ -73,7 +73,7 @@ fshelp_acquire_lock (struct lock_box *box, int *user, struct mutex *mut, } /* If there is an exclusive lock, wait for it to end. */ - while (lock->type == LOCK_EX) + while (box->type == LOCK_EX) { if (flags & LOCK_NB) return EWOULDBLOCK; |