mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
9pserve: fix a new race involving assert(c->nmsg == 0).
Just like outputthread can have processed the message but not yet called msgput, the same is true of the connoutthread, so we cannot check c->nmsg until after the connoutthread has shut down gracefully.
This commit is contained in:
parent
ebda53e16b
commit
4a6f051073
1 changed files with 3 additions and 3 deletions
|
@ -560,13 +560,13 @@ connthread(void *arg)
|
|||
sendq(outq, &sync);
|
||||
recvp(c->outqdead);
|
||||
|
||||
/* should be no messages left anywhere. */
|
||||
assert(c->nmsg == 0);
|
||||
|
||||
/* everything is quiet; can close the local output queue. */
|
||||
sendq(c->outq, nil);
|
||||
recvp(c->outqdead);
|
||||
|
||||
/* should be no messages left anywhere. */
|
||||
assert(c->nmsg == 0);
|
||||
|
||||
/* clunk all outstanding fids */
|
||||
for(i=0; i<NHASH; i++){
|
||||
for(h=c->fid[i]; h; h=hnext){
|
||||
|
|
Loading…
Reference in a new issue