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 /sys/src/9/port/devproc.c | |
parent | c2212865791d11a38c9e65654fd2f3feff840d3b (diff) |
eqlock(): use eqlock when interruption is possible
Diffstat (limited to 'sys/src/9/port/devproc.c')
-rw-r--r-- | sys/src/9/port/devproc.c | 19 |
1 files changed, 10 insertions, 9 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(); |