diff options
-rw-r--r-- | libgo/runtime/proc.c | 5 |
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 |