| Date: Wed, 22 Aug 2007 09:14:25 -0400
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.
Diffstat:
M src/cmd/9pserve.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- |
| t@@ -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; ifid[i]; h; h=hnext){ |