avoid double lock (lucho ionkov)

This commit is contained in:
rsc 2006-04-19 22:04:00 +00:00
parent 90a99688be
commit 90a356572c
2 changed files with 5 additions and 3 deletions

View file

@ -84,8 +84,8 @@ if(chatty9p > 1)
closefid(r->afid); closefid(r->afid);
if(r->oldreq) if(r->oldreq)
closereq(r->oldreq); closereq(r->oldreq);
for(i=0; i<r->nflush; i++) if(r->nflush)
respond(r->flush[i], nil); fprint(2, "closereq: flushes remaining\n");
free(r->flush); free(r->flush);
switch(r->ifcall.type){ switch(r->ifcall.type){
case Tstat: case Tstat:

View file

@ -856,8 +856,10 @@ if(chatty9p)
free: free:
qlock(&r->lk); /* no one will add flushes now */ 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); respond(r->flush[i], nil);
}
free(r->flush); free(r->flush);
r->nflush = 0; r->nflush = 0;
r->flush = nil; r->flush = nil;