aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libgo/runtime/proc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c
index 7011f14..de2a54b 100644
--- a/libgo/runtime/proc.c
+++ b/libgo/runtime/proc.c
@@ -1983,7 +1983,10 @@ runtime_exitsyscall(void)
#endif
gp->gcnext_sp = nil;
runtime_memclr(&gp->gcregs, sizeof gp->gcregs);
- m->p->syscalltick++;
+
+ // Don't refer to m again, we might be running on a different
+ // thread after returning from runtime_mcall.
+ runtime_m()->p->syscalltick++;
}
static bool