ref: 0a0435dbc128705e1e4e3c1e2d45f686485d1dcd
parent: 9574793fc7c30c20bd544ee025f44bdd7bb72fd5
author: aiju <[email protected]>
date: Fri Aug 19 15:33:36 EDT 2011
lib9p reqqueue: more cleaning
--- a/sys/include/9p.h
+++ b/sys/include/9p.h
@@ -283,4 +283,3 @@
Reqqueue* reqqueuecreate(void);
void reqqueuepush(Reqqueue*, Req*, void (*)(Req *));
void reqqueueflush(Reqqueue*, Req*);
-int reqqueueflushed(void);
--- a/sys/src/lib9p/queue.c
+++ b/sys/src/lib9p/queue.c
@@ -18,7 +18,6 @@
void (*f)(Req *);
q = v;
- *threaddata() = q;
rfork(RFNOTEG);
threadnotify(_reqqueuenote, 1);
for(;;){
@@ -30,9 +29,7 @@
r->qu.next->prev = r->qu.prev;
r->qu.prev->next = r->qu.next;
f = r->qu.f;
- qlock(&r->lk);
memset(&r->qu, 0, sizeof(r->qu));
- qunlock(&r->lk);
q->cur = r;
qunlock(q);
f(r);
@@ -49,7 +46,6 @@
q->l = q;
q->next = q->prev = q;
q->pid = threadpid(proccreate(_reqqueueproc, q, mainstacksize));
- print("%d\n", q->pid);
return q;
}
@@ -62,7 +58,7 @@
r->qu.prev = q->prev;
q->prev->next = &r->qu;
q->prev = &r->qu;
- rwakeupall(q);
+ rwakeup(q);
qunlock(q);
}
@@ -78,9 +74,7 @@
r->qu.next->prev = r->qu.prev;
r->qu.prev->next = r->qu.next;
}
- qlock(&r->lk);
memset(&r->qu, 0, sizeof(r->qu));
- qunlock(&r->lk);
qunlock(q);
respond(r, "interrupted");
}