From 5887f142a33fbb8da94088e902ced4101a16aa8f Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Wed, 17 Jul 2013 12:52:37 -0400 Subject: runtime: more reliable preemption Currently preemption signal g->stackguard0==StackPreempt can be lost if it is received when preemption is disabled (e.g. m->lock!=0). This change duplicates the preemption signal in g->preempt and restores g->stackguard0 when preemption is enabled. Update #543. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/10792043 --- src/pkg/runtime/runtime.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pkg/runtime/runtime.h') diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h index ce451b0105..34d9541e98 100644 --- a/src/pkg/runtime/runtime.h +++ b/src/pkg/runtime/runtime.h @@ -253,6 +253,7 @@ struct G bool issystem; // do not output in stack dump bool isbackground; // ignore in deadlock detector bool blockingsyscall; // hint that the next syscall will block + bool preempt; // preemption signal, duplicates stackguard0 = StackPreempt int8 raceignore; // ignore race detection events M* m; // for debuggers, but offset not hard-coded M* lockedm; -- cgit v1.3