• Russ Cox's avatar
    runtime: pass to signal handler value of g at time of signal · 690291a2
    Russ Cox authored
    The existing code assumed that signals only arrived
    while executing on the goroutine stack (g == m->curg),
    not while executing on the scheduler stack (g == m->g0).
    
    Most of the signal handling trampolines correctly saved
    and restored g already, but the sighandler C code did not
    have access to it.
    
    Some rewriting of assembly to make the various
    implementations as similar as possible.
    
    Will need to change Windows too but I don't
    understand how sigtramp gets called there.
    
    R=r
    CC=golang-dev
    https://golang.org/cl/4203042
    690291a2
sys.s 3.53 KB