ref: a52bf27a6876bc3bb7267fbaed05e8f3a3f89f94
parent: f1a48614883190c0a7f8119e70433daaffb6c321
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Mon Jan 9 16:18:03 EST 2012
eqlock: dont rely on notepending flag when detecting eqlock interruption
--- a/sys/src/9/port/proc.c
+++ b/sys/src/9/port/proc.c
@@ -892,6 +892,7 @@
postnote(Proc *p, int dolock, char *n, int flag)
{int s, ret;
+ QLock *q;
if(dolock)
qlock(&p->debug);
@@ -943,13 +944,9 @@
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){--- a/sys/src/9/port/qlock.c
+++ b/sys/src/9/port/qlock.c
@@ -54,10 +54,9 @@
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);
}
}
--
⑨