diff options
author | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-08-11 04:25:51 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-08-11 04:25:51 +0200 |
commit | 4ec0e921e5fb0ff51f74840968644c66e1e4c595 (patch) | |
tree | 133fd00f52f3c7c44c3820f9e25d426b48482c89 | |
parent | c2212865791d11a38c9e65654fd2f3feff840d3b (diff) |
eqlock(): use eqlock when interruption is possible
-rw-r--r-- | sys/src/9/port/devproc.c | 19 | ||||
-rw-r--r-- | sys/src/9/port/log.c | 2 | ||||
-rw-r--r-- | sys/src/9/port/sysfile.c | 4 |
3 files changed, 13 insertions, 12 deletions
diff --git a/sys/src/9/port/devproc.c b/sys/src/9/port/devproc.c index f133f3d5d..ed80e63e9 100644 --- a/sys/src/9/port/devproc.c +++ b/sys/src/9/port/devproc.c @@ -370,7 +370,7 @@ procopen(Chan *c, int omode) } p = proctab(SLOT(c->qid)); - qlock(&p->debug); + eqlock(&p->debug); if(waserror()){ qunlock(&p->debug); nexterror(); @@ -476,12 +476,13 @@ procwstat(Chan *c, uchar *db, int n) 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 @@ procwstat(Chan *c, uchar *db, int n) if(d->mode != ~0UL) p->procmode = d->mode&0777; + qunlock(&p->debug); poperror(); free(d); - qunlock(&p->debug); return n; } @@ -563,7 +564,7 @@ procfds(Proc *p, char *va, int count, long offset) count = sizeof buf; a = buf; - qlock(&p->debug); + eqlock(&p->debug); f = p->fgrp; if(f == nil){ qunlock(&p->debug); @@ -721,7 +722,7 @@ procread(Chan *c, void *va, long n, vlong off) 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 @@ procread(Chan *c, void *va, long n, vlong off) return n; case Qnote: - qlock(&p->debug); + eqlock(&p->debug); if(waserror()){ qunlock(&p->debug); nexterror(); @@ -929,7 +930,7 @@ procread(Chan *c, void *va, long n, vlong off) return n; case Qns: - qlock(&p->debug); + eqlock(&p->debug); if(waserror()){ qunlock(&p->debug); nexterror(); @@ -1035,7 +1036,7 @@ procwrite(Chan *c, void *va, long n, vlong off) return n; } - qlock(&p->debug); + eqlock(&p->debug); if(waserror()){ qunlock(&p->debug); nexterror(); diff --git a/sys/src/9/port/log.c b/sys/src/9/port/log.c index 34edda696..9ff1b9342 100644 --- a/sys/src/9/port/log.c +++ b/sys/src/9/port/log.c @@ -57,7 +57,7 @@ logread(Log *alog, void *a, ulong, long n) int i, d; char *p, *rptr; - qlock(&alog->readq); + eqlock(&alog->readq); if(waserror()){ qunlock(&alog->readq); nexterror(); diff --git a/sys/src/9/port/sysfile.c b/sys/src/9/port/sysfile.c index 87b0cba3b..85fee6772 100644 --- a/sys/src/9/port/sysfile.c +++ b/sys/src/9/port/sysfile.c @@ -328,7 +328,7 @@ unionread(Chan *c, void *va, long n) Mhead *m; Mount *mount; - qlock(&c->umqlock); + eqlock(&c->umqlock); m = c->umh; rlock(&m->lock); mount = m->mount; @@ -368,7 +368,7 @@ unionread(Chan *c, void *va, long n) static void unionrewind(Chan *c) { - qlock(&c->umqlock); + eqlock(&c->umqlock); c->uri = 0; if(c->umc){ cclose(c->umc); |