From f52b47eea4c5de553d202669f91e6f4f14668592 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 1 Jul 2019 23:35:27 +0300 Subject: Add workaround for data race in libstdc++'s locale(const locale&, Facet*) constructor --- libbuild2/module.hxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'libbuild2/module.hxx') diff --git a/libbuild2/module.hxx b/libbuild2/module.hxx index 5fbed9c..7d94837 100644 --- a/libbuild2/module.hxx +++ b/libbuild2/module.hxx @@ -56,12 +56,18 @@ namespace build2 module_init_function* init; }; - // The register() function will be written in C++ and will be called from - // C++ but we need to suppress name mangling to be able to use dlsym() and - // equivalent. + // The build2__load() function will be written in C++ and will be + // called from C++ but we need to suppress name mangling to be able to use + // dlsym() or equivalent. + // + // Note that the load() function is guaranteed to be called during serial + // execution (either from main() or during the load phase). + // + // @@ I wonder if returning a "C++ struct" (it contains pointer to functions + // with signatures containing C++ type) is kosher. // extern "C" - using module_register_function = module_functions (); + using module_load_function = module_functions (); // Loaded modules state. // -- cgit v1.1