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:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user