aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/hashmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/hashmap.c')
-rw-r--r--src/pkg/runtime/hashmap.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pkg/runtime/hashmap.c b/src/pkg/runtime/hashmap.c
index 870274ae91..5bcd8bf416 100644
--- a/src/pkg/runtime/hashmap.c
+++ b/src/pkg/runtime/hashmap.c
@@ -744,6 +744,9 @@ mapaccess(Hmap *h, byte *ak, byte *av, bool *pres)
{
byte *res;
+ if(gcwaiting)
+ gosched();
+
res = nil;
if(hash_lookup(h, ak, (void**)&res)) {
*pres = true;
@@ -812,6 +815,9 @@ mapassign(Hmap *h, byte *ak, byte *av)
byte *res;
int32 hit;
+ if(gcwaiting)
+ gosched();
+
res = nil;
if(av == nil) {
hash_remove(h, ak, (void**)&res);
@@ -908,6 +914,9 @@ mapiterinit(Hmap *h)
void
runtime·mapiternext(struct hash_iter *it)
{
+ if(gcwaiting)
+ gosched();
+
it->data = hash_next(it);
if(debug) {
prints("runtime·mapiternext: iter=");