summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-04-30 07:38:03 -0700
committerTom Stellard <thomas.stellard@amd.com>2013-05-06 09:06:03 -0700
commit55eb8eaaa8bf8696d56effce6ed87f03bea779e0 (patch)
tree75ecb6e94cfeb4c0898d9a3bf2c76fff3beb69c0 /src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
parent7cc98ea88f5ec24369ba8123007637e47f093726 (diff)
downloadexternal_mesa3d-55eb8eaaa8bf8696d56effce6ed87f03bea779e0.zip
external_mesa3d-55eb8eaaa8bf8696d56effce6ed87f03bea779e0.tar.gz
external_mesa3d-55eb8eaaa8bf8696d56effce6ed87f03bea779e0.tar.bz2
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
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_misc.cpp')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_misc.cpp15
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 a531d98..897f7ff 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)