

Well, I'm really stupid, I can't believe how I never noticed this. On the
waking up path, we never marked the object locked! So we returned true to the
one in the waitqueue (but don't really grant him the lock), and also to the
next one, and so on.

I'm ashamed.

Thanks to Ron Burkey for reporting this embarrasing bug.



---

 cur-root/net.c |    3 +++
 1 files changed, 3 insertions(+)

diff -puN net.c~acquire_on_wakeup net.c
--- cur/net.c~acquire_on_wakeup	2004-04-20 19:25:15.000000000 -0300
+++ cur-root/net.c	2004-04-20 19:25:58.000000000 -0300
@@ -547,6 +547,9 @@ int net_wakeup(struct hentry *h) {
 	free(h->wq);
 	h->wq = p;
 	h->fd = fd;
+
+	/* of course, mark it locked */
+	h->locked = 1;
 	
 	/* add the open lock; the caller will take care to remove from the
 	 * other queue */

_
