lib9p reqqueue: more cleaning
This commit is contained in:
parent
9574793fc7
commit
0a0435dbc1
2 changed files with 1 additions and 8 deletions
|
@ -283,4 +283,3 @@ void srvrelease(Srv *);
|
||||||
Reqqueue* reqqueuecreate(void);
|
Reqqueue* reqqueuecreate(void);
|
||||||
void reqqueuepush(Reqqueue*, Req*, void (*)(Req *));
|
void reqqueuepush(Reqqueue*, Req*, void (*)(Req *));
|
||||||
void reqqueueflush(Reqqueue*, Req*);
|
void reqqueueflush(Reqqueue*, Req*);
|
||||||
int reqqueueflushed(void);
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ _reqqueueproc(void *v)
|
||||||
void (*f)(Req *);
|
void (*f)(Req *);
|
||||||
|
|
||||||
q = v;
|
q = v;
|
||||||
*threaddata() = q;
|
|
||||||
rfork(RFNOTEG);
|
rfork(RFNOTEG);
|
||||||
threadnotify(_reqqueuenote, 1);
|
threadnotify(_reqqueuenote, 1);
|
||||||
for(;;){
|
for(;;){
|
||||||
|
@ -30,9 +29,7 @@ _reqqueueproc(void *v)
|
||||||
r->qu.next->prev = r->qu.prev;
|
r->qu.next->prev = r->qu.prev;
|
||||||
r->qu.prev->next = r->qu.next;
|
r->qu.prev->next = r->qu.next;
|
||||||
f = r->qu.f;
|
f = r->qu.f;
|
||||||
qlock(&r->lk);
|
|
||||||
memset(&r->qu, 0, sizeof(r->qu));
|
memset(&r->qu, 0, sizeof(r->qu));
|
||||||
qunlock(&r->lk);
|
|
||||||
q->cur = r;
|
q->cur = r;
|
||||||
qunlock(q);
|
qunlock(q);
|
||||||
f(r);
|
f(r);
|
||||||
|
@ -49,7 +46,6 @@ reqqueuecreate(void)
|
||||||
q->l = q;
|
q->l = q;
|
||||||
q->next = q->prev = q;
|
q->next = q->prev = q;
|
||||||
q->pid = threadpid(proccreate(_reqqueueproc, q, mainstacksize));
|
q->pid = threadpid(proccreate(_reqqueueproc, q, mainstacksize));
|
||||||
print("%d\n", q->pid);
|
|
||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +58,7 @@ reqqueuepush(Reqqueue *q, Req *r, void (*f)(Req *))
|
||||||
r->qu.prev = q->prev;
|
r->qu.prev = q->prev;
|
||||||
q->prev->next = &r->qu;
|
q->prev->next = &r->qu;
|
||||||
q->prev = &r->qu;
|
q->prev = &r->qu;
|
||||||
rwakeupall(q);
|
rwakeup(q);
|
||||||
qunlock(q);
|
qunlock(q);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,9 +74,7 @@ reqqueueflush(Reqqueue *q, Req *r)
|
||||||
r->qu.next->prev = r->qu.prev;
|
r->qu.next->prev = r->qu.prev;
|
||||||
r->qu.prev->next = r->qu.next;
|
r->qu.prev->next = r->qu.next;
|
||||||
}
|
}
|
||||||
qlock(&r->lk);
|
|
||||||
memset(&r->qu, 0, sizeof(r->qu));
|
memset(&r->qu, 0, sizeof(r->qu));
|
||||||
qunlock(&r->lk);
|
|
||||||
qunlock(q);
|
qunlock(q);
|
||||||
respond(r, "interrupted");
|
respond(r, "interrupted");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue