summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/chan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/chan.c')
-rw-r--r--src/pkg/runtime/chan.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pkg/runtime/chan.c b/src/pkg/runtime/chan.c
index b2a0b4fac..ec33d3f1b 100644
--- a/src/pkg/runtime/chan.c
+++ b/src/pkg/runtime/chan.c
@@ -174,6 +174,9 @@ chansend(Hchan *c, byte *ep, bool *pres)
SudoG *sg;
G* gp;
+ if(gcwaiting)
+ gosched();
+
if(debug) {
prints("chansend: chan=");
runtime·printpointer(c);
@@ -277,6 +280,9 @@ chanrecv(Hchan* c, byte *ep, bool* pres)
SudoG *sg;
G *gp;
+ if(gcwaiting)
+ gosched();
+
if(debug) {
prints("chanrecv: chan=");
runtime·printpointer(c);
@@ -631,6 +637,9 @@ runtime·selectgo(Select *sel)
G *gp;
byte *as;
+ if(gcwaiting)
+ gosched();
+
if(debug) {
prints("selectgo: sel=");
runtime·printpointer(sel);
@@ -908,6 +917,9 @@ runtime·closechan(Hchan *c)
SudoG *sg;
G* gp;
+ if(gcwaiting)
+ gosched();
+
lock(c);
incerr(c);
c->closed |= Wclosed;