• Richard Miller's avatar
    runtime: avoid fork/exit race in plan9 · 967b9940
    Richard Miller authored
    There's a race between runtime.goexitsall killing all OS processes
    of a go program in order to exit, and runtime.newosproc forking a
    new one.  If the new process has been created but not yet stored
    its pid in m.procid, it will not be killed by goexitsall and
    deadlock results.
    
    This CL prevents the race by making the newly forked process
    check whether the program is exiting.  It also prevents a
    potential "shoot-out" if multiple goroutines call Exit at
    the same time, which could possibly lead to two processes
    killing each other and leaving the rest deadlocked.
    
    Change-Id: I3170b4a62d2461f6b029b3d6aad70373714ed53e
    Reviewed-on: https://go-review.googlesource.com/21135
    Run-TryBot: David du Colombier <0intro@gmail.com>
    Reviewed-by: 's avatarMarvin Stenger <marvin.stenger94@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarDavid du Colombier <0intro@gmail.com>
    967b9940
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...