mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
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:
parent
7cc98ea88f
commit
55eb8eaaa8
2 changed files with 15 additions and 14 deletions
|
|
@ -79,6 +79,21 @@
|
||||||
|
|
||||||
#include "lp_bld_misc.h"
|
#include "lp_bld_misc.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
class LLVMEnsureMultithreaded {
|
||||||
|
public:
|
||||||
|
LLVMEnsureMultithreaded()
|
||||||
|
{
|
||||||
|
if (!LLVMIsMultithreaded()) {
|
||||||
|
LLVMStartMultithreaded();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static LLVMEnsureMultithreaded lLVMEnsureMultithreaded;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" void
|
extern "C" void
|
||||||
lp_set_target_options(void)
|
lp_set_target_options(void)
|
||||||
|
|
|
||||||
|
|
@ -58,20 +58,6 @@
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
class LLVMEnsureMultithreaded {
|
|
||||||
public:
|
|
||||||
LLVMEnsureMultithreaded()
|
|
||||||
{
|
|
||||||
llvm_start_multithreaded();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static LLVMEnsureMultithreaded lLVMEnsureMultithreaded;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the shader type we want to compile
|
* Set the shader type we want to compile
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue