diff options
author | Tom Stellard <[email protected]> | 2013-04-30 07:38:03 -0700 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2013-05-06 09:06:03 -0700 |
commit | 55eb8eaaa8bf8696d56effce6ed87f03bea779e0 (patch) | |
tree | 75ecb6e94cfeb4c0898d9a3bf2c76fff3beb69c0 /src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | |
parent | 7cc98ea88f5ec24369ba8123007637e47f093726 (diff) |
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: [email protected]
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_misc.cpp')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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) |