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
This commit is contained in:
Tom Stellard 2013-04-30 07:38:03 -07:00
parent 7cc98ea88f
commit 55eb8eaaa8
2 changed files with 15 additions and 14 deletions

View file

@ -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)

View file

@ -58,20 +58,6 @@
using namespace llvm;
namespace {
class LLVMEnsureMultithreaded {
public:
LLVMEnsureMultithreaded()
{
llvm_start_multithreaded();
}
};
static LLVMEnsureMultithreaded lLVMEnsureMultithreaded;
}
/**
* Set the shader type we want to compile
*