ref: a6237be271683eb82c31726df8415a31647a4222
parent: 117e7dea7f58868a63198edce9d4a03caa64f1ae
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Thu Aug 11 00:25:51 EDT 2011
eqlock(): use eqlock when interruption is possible
--- a/sys/src/9/port/devproc.c
+++ b/sys/src/9/port/devproc.c
@@ -370,7 +370,7 @@
}
p = proctab(SLOT(c->qid));
- qlock(&p->debug);
+ eqlock(&p->debug);
if(waserror()){qunlock(&p->debug);
nexterror();
@@ -476,12 +476,13 @@
p = proctab(SLOT(c->qid));
nonone(p);
d = nil;
+
+ eqlock(&p->debug);
if(waserror()){- free(d);
qunlock(&p->debug);
+ free(d);
nexterror();
}
- qlock(&p->debug);
if(p->pid != PID(c->qid))
error(Eprocdied);
@@ -503,9 +504,9 @@
if(d->mode != ~0UL)
p->procmode = d->mode&0777;
+ qunlock(&p->debug);
poperror();
free(d);
- qunlock(&p->debug);
return n;
}
@@ -563,7 +564,7 @@
count = sizeof buf;
a = buf;
- qlock(&p->debug);
+ eqlock(&p->debug);
f = p->fgrp;
if(f == nil){qunlock(&p->debug);
@@ -721,7 +722,7 @@
switch(QID(c->qid)){case Qargs:
- qlock(&p->debug);
+ eqlock(&p->debug);
j = procargs(p, up->genbuf, sizeof up->genbuf);
qunlock(&p->debug);
if(offset >= j)
@@ -776,7 +777,7 @@
return n;
case Qnote:
- qlock(&p->debug);
+ eqlock(&p->debug);
if(waserror()){qunlock(&p->debug);
nexterror();
@@ -929,7 +930,7 @@
return n;
case Qns:
- qlock(&p->debug);
+ eqlock(&p->debug);
if(waserror()){qunlock(&p->debug);
nexterror();
@@ -1035,7 +1036,7 @@
return n;
}
- qlock(&p->debug);
+ eqlock(&p->debug);
if(waserror()){qunlock(&p->debug);
nexterror();
--- a/sys/src/9/port/log.c
+++ b/sys/src/9/port/log.c
@@ -57,7 +57,7 @@
int i, d;
char *p, *rptr;
- qlock(&alog->readq);
+ eqlock(&alog->readq);
if(waserror()){qunlock(&alog->readq);
nexterror();
--- a/sys/src/9/port/sysfile.c
+++ b/sys/src/9/port/sysfile.c
@@ -328,7 +328,7 @@
Mhead *m;
Mount *mount;
- qlock(&c->umqlock);
+ eqlock(&c->umqlock);
m = c->umh;
rlock(&m->lock);
mount = m->mount;
@@ -368,7 +368,7 @@
static void
unionrewind(Chan *c)
{- qlock(&c->umqlock);
+ eqlock(&c->umqlock);
c->uri = 0;
if(c->umc){cclose(c->umc);
--
⑨