Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(iant): For the case of a new C thread calling into Go, such #1349

Open
piascikj opened this Issue Oct 4, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@piascikj
Copy link
Member

piascikj commented Oct 4, 2016

as when using -buildmode=c-archive, we know that Go runtime
initialization is complete but we do not know that all Go init
functions have been run. We should not fetch cgo_context_function
until they have been, because that is where a call to
SetCgoTraceback is likely to occur. We are going to wait for Go
initialization to be complete anyhow, later, by waiting for
main_init_done to be closed in cgocallbackg1. We should wait here
instead. See also issue golang#15943.

opened via imdone.io from a code comment on fa49c397 by Daniel Theophanes

TODO (iant): For the case of a new C thread calling into Go, such id:1341


// TODO(iant): For the case of a new C thread calling into Go, such
// as when using -buildmode=c-archive, we know that Go runtime
// initialization is complete but we do not know that all Go init
// functions have been run. We should not fetch cgo_context_function
// until they have been, because that is where a call to
// SetCgoTraceback is likely to occur. We are going to wait for Go
// initialization to be complete anyhow, later, by waiting for
// main_init_done to be closed in cgocallbackg1. We should wait here
// instead. See also issue #15943.
pfn = cgo_context_function;
pthread_mutex_unlock(&runtime_init_mu);
if (pfn != nil) {
struct context_arg arg;

@piascikj piascikj added the TODO label Jan 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.