ref: 915c9292bd567dece60f1e4348362f758b0f5265
parent: fe5b48a5b45af2b4a4351d369df01bbeec29df23
author: cinap_lenrek <cinap_lenrek@localhost>
date: Sat Jul 9 09:15:39 EDT 2011
qio: naive fixing attempt on issue #64
--- a/sys/src/9/port/qio.c
+++ b/sys/src/9/port/qio.c
@@ -1156,8 +1156,6 @@
return q->len < q->limit || (q->state & Qclosed);
}
-ulong noblockcnt;
-
/*
* add a block to a queue obeying flow control
*/
@@ -1191,15 +1189,18 @@
error(q->err);
}
- /* if nonblocking, don't queue over the limit */
+ /* don't queue over the limit */
if(q->len >= q->limit){ if(q->noblock){iunlock(q);
freeb(b);
- noblockcnt += n;
qunlock(&q->wlock);
poperror();
return n;
+ }
+ if(q->len >= q->limit*2){+ iunlock(q);
+ error(Egreg);
}
}
--
⑨