Commit 4ac93a53 by Yinghai Lu Committed by Tianqi Chen

Fix a multithreaded bug in llvm LazyInitJIT (#3158)

parent 9089e196
......@@ -226,8 +226,10 @@ class LLVMModuleNode final : public runtime::ModuleNode {
private:
void LazyInitJIT() {
CHECK(ee_ == nullptr);
std::lock_guard<std::mutex> lock(mutex_);
if (ee_) {
return;
}
llvm::EngineBuilder builder(std::move(module_));
std::string triple, mcpu, mattr;
llvm::TargetOptions opt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment