• David Crawshaw's avatar
    runtime: make cgocallback wait on package init · 3b22ffc0
    David Crawshaw authored
    With the new buildmodes c-archive and c-shared, it is possible for a
    cgo call to come in early in the lifecycle of a Go program. Calls
    before the runtime has been initialized are caught by
    _cgo_wait_runtime_init_done. However a call can come in after the
    runtime has initialized, but before the program's package init
    functions have finished running.
    
    To avoid this cgocallback checks m.ncgo to see if we are on a thread
    running Go. If not, we may be a foreign thread and it blocks until
    main_init is complete.
    
    Change-Id: I7a9f137fa2a40c322a0b93764261f9aa17fcf5b8
    Reviewed-on: https://go-review.googlesource.com/8897Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    Run-TryBot: David Crawshaw <crawshaw@golang.org>
    3b22ffc0
Name
Last commit
Last update
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...