From e440d414d57af87e40fff560b58077443af91696 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 27 Apr 2012 18:51:15 +0200 Subject: fix missed clunkq wakeup race --- sys/src/9/port/chan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/src/9/port/chan.c b/sys/src/9/port/chan.c index 6c86aff03..203f5bcba 100644 --- a/sys/src/9/port/chan.c +++ b/sys/src/9/port/chan.c @@ -500,17 +500,16 @@ closeproc(void*) poperror(); } } + qunlock(&clunkq.q); lock(&clunkq.l); c = clunkq.head; if(c == nil){ unlock(&clunkq.l); - qunlock(&clunkq.q); pexit("no work", 1); } clunkq.head = c->next; clunkq.nclosed++; unlock(&clunkq.l); - qunlock(&clunkq.q); if(!waserror()){ devtab[c->type]->close(c); poperror(); -- cgit v1.2.3