diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2004-07-21 12:10:21 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2004-07-21 12:10:21 +0000 |
commit | d84caa6ccda61ba917d2414b34cf487ddce71202 (patch) | |
tree | d149b6178c2071cb38d15a62976cdd8ff48987ae /sys/kern/kern_rwlock.c | |
parent | fdcb384533ab1fd50b17effc08ff987556bbaccc (diff) |
I was wrong. The assymetry created by the proc argument to rw_enter_write
is horrible and doesn't add anything.
Remove it.
XXX - the fdplock macro will need a separate cleanup.
niklas@ markus@ ok
Diffstat (limited to 'sys/kern/kern_rwlock.c')
-rw-r--r-- | sys/kern/kern_rwlock.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index 994e1dd5e54..833d879d98c 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_rwlock.c,v 1.2 2003/11/18 18:12:14 tedu Exp $ */ +/* $OpenBSD: kern_rwlock.c,v 1.3 2004/07/21 12:10:20 art Exp $ */ /* * Copyright (c) 2002, 2003 Artur Grabowski <art@openbsd.org> * All rights reserved. @@ -49,8 +49,10 @@ rw_enter_read(struct rwlock *rwl) } void -rw_enter_write(struct rwlock *rwl, struct proc *p) +rw_enter_write(struct rwlock *rwl) { + struct proc *p = curproc; + while (__predict_false(rwl->rwl_owner != 0)) { /* * Not the simple case, go to slow path. @@ -208,7 +210,7 @@ rwlock_testp3(void *a) printf("rwlock test3 start\n"); tsleep(&local, PWAIT, "rw3", 2); printf("rwlock test3 exited waiting\n"); - rw_enter_write(&rw_test, curproc); + rw_enter_write(&rw_test); printf("rwlock test3 obtained\n"); tsleep(&local, PWAIT, "rw3/2", 4); rw_exit_write(&rw_test); |