plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit 90a356572cc47a20e6ef6044c7f14167ab9edd9a
parent 90a99688be7fd813273e1f1f28ba8fa34cb9dc44
Author: rsc <devnull@localhost>
Date:   Wed, 19 Apr 2006 22:04:00 +0000

avoid double lock (lucho ionkov)

Diffstat:
Msrc/lib9p/req.c | 4++--
Msrc/lib9p/srv.c | 4+++-
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/lib9p/req.c b/src/lib9p/req.c @@ -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: diff --git a/src/lib9p/srv.c b/src/lib9p/srv.c @@ -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;