eqlock: dont rely on notepending flag when detecting eqlock interruption
parent
7cd268a783
commit
85fd5bf58d
|
@ -892,6 +892,7 @@ int
|
|||
postnote(Proc *p, int dolock, char *n, int flag)
|
||||
{
|
||||
int s, ret;
|
||||
QLock *q;
|
||||
|
||||
if(dolock)
|
||||
qlock(&p->debug);
|
||||
|
@ -943,13 +944,9 @@ postnote(Proc *p, int dolock, char *n, int flag)
|
|||
switch(p->state){
|
||||
case Queueing:
|
||||
/* Try and pull out of a eqlock */
|
||||
if(p->notepending){
|
||||
QLock *q;
|
||||
|
||||
if((q = p->eql) == nil)
|
||||
break;
|
||||
if(q = p->eql){
|
||||
lock(&q->use);
|
||||
if(p->state == Queueing && p->eql == q && p->notepending){
|
||||
if(p->state == Queueing && p->eql == q){
|
||||
Proc *d, *l;
|
||||
|
||||
for(l = nil, d = q->head; d; l = d, d = d->qnext){
|
||||
|
|
|
@ -54,10 +54,9 @@ eqlock(QLock *q)
|
|||
up->state = Queueing;
|
||||
unlock(&q->use);
|
||||
sched();
|
||||
if(up->notepending){
|
||||
up->notepending = 0;
|
||||
if(up->eql == q)
|
||||
qunlock(q);
|
||||
if(up->eql == 0){
|
||||
if(up->notepending)
|
||||
up->notepending = 0;
|
||||
error(Eintr);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue