From 55eb8eaaa8bf8696d56effce6ed87f03bea779e0 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 30 Apr 2013 07:38:03 -0700 Subject: gallivm: Move LLVMStartMultithreaded() static initializer into gallivm This does not solve all of the problems with using LLVM in a multithreaded enivronment, but it should help in some cases. Reviewed-by: Mathias.Froehlich@web.de --- src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/gallium/auxiliary/gallivm/lp_bld_misc.cpp') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp index a531d98e881..897f7ffb276 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp @@ -79,6 +79,21 @@ #include "lp_bld_misc.h" +namespace { + +class LLVMEnsureMultithreaded { +public: + LLVMEnsureMultithreaded() + { + if (!LLVMIsMultithreaded()) { + LLVMStartMultithreaded(); + } + } +}; + +static LLVMEnsureMultithreaded lLVMEnsureMultithreaded; + +} extern "C" void lp_set_target_options(void) -- cgit v1.2.3