Example #1
0
// Releases the cgo traceback context.
void _cgo_release_context(uintptr_t ctxt) {
	void (*pfn)(struct context_arg*);

	pfn = _cgo_get_context_function();
	if (ctxt != 0 && pfn != nil) {
		struct context_arg arg;

		arg.Context = ctxt;
		(*pfn)(&arg);
	}
}
Example #2
0
uintptr_t
_cgo_wait_runtime_init_done() {
	void (*pfn)(struct context_arg*);

	 _cgo_maybe_run_preinit();
	while (!_cgo_is_runtime_initialized()) {
			WaitForSingleObject(runtime_init_wait, INFINITE);
	}
	pfn = _cgo_get_context_function();
	if (pfn != nil) {
		struct context_arg arg;

		arg.Context = 0;
		(*pfn)(&arg);
		return arg.Context;
	}
	return 0;
}