tavoid double lock (lucho ionkov) - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 90a356572cc47a20e6ef6044c7f14167ab9edd9a
(DIR) parent 90a99688be7fd813273e1f1f28ba8fa34cb9dc44
(HTM) Author: rsc <devnull@localhost>
Date: Wed, 19 Apr 2006 22:04:00 +0000
avoid double lock (lucho ionkov)
Diffstat:
M src/lib9p/req.c | 4 ++--
M src/lib9p/srv.c | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/src/lib9p/req.c b/src/lib9p/req.c
t@@ -84,8 +84,8 @@ if(chatty9p > 1)
closefid(r->afid);
if(r->oldreq)
closereq(r->oldreq);
- for(i=0; i<r->nflush; i++)
- respond(r->flush[i], nil);
+ if(r->nflush)
+ fprint(2, "closereq: flushes remaining\n");
free(r->flush);
switch(r->ifcall.type){
case Tstat:
(DIR) diff --git a/src/lib9p/srv.c b/src/lib9p/srv.c
t@@ -856,8 +856,10 @@ if(chatty9p)
free:
qlock(&r->lk); /* no one will add flushes now */
- for(i=0; i<r->nflush; i++)
+ for(i=0; i<r->nflush; i++){
+ r->flush[i]->oldreq = nil; /* so it doesn't try to lock us! */
respond(r->flush[i], nil);
+ }
free(r->flush);
r->nflush = 0;
r->flush = nil;