eqlock: dont rely on notepending flag when detecting eqlock interruption

front
cinap_lenrek 2012-01-09 21:18:03 +01:00
parent 7cd268a783
commit 85fd5bf58d
2 changed files with 6 additions and 10 deletions

View File

@ -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){

View File

@ -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);
}
}