Revert r57340 move guard mutex in getPointerToFunction as this can cause
deadlock issues with java llvm-svn: 57356
This commit is contained in:
parent
796bc4e6ce
commit
297364cd3b
|
@ -489,8 +489,6 @@ void *JIT::getPointerToFunction(Function *F) {
|
||||||
if (void *Addr = getPointerToGlobalIfAvailable(F))
|
if (void *Addr = getPointerToGlobalIfAvailable(F))
|
||||||
return Addr; // Check if function already code gen'd
|
return Addr; // Check if function already code gen'd
|
||||||
|
|
||||||
MutexGuard locked(lock);
|
|
||||||
|
|
||||||
// Make sure we read in the function if it exists in this Module.
|
// Make sure we read in the function if it exists in this Module.
|
||||||
if (F->hasNotBeenReadFromBitcode()) {
|
if (F->hasNotBeenReadFromBitcode()) {
|
||||||
// Determine the module provider this function is provided by.
|
// Determine the module provider this function is provided by.
|
||||||
|
@ -516,6 +514,8 @@ void *JIT::getPointerToFunction(Function *F) {
|
||||||
return Addr;
|
return Addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MutexGuard locked(lock);
|
||||||
|
|
||||||
if (F->isDeclaration()) {
|
if (F->isDeclaration()) {
|
||||||
void *Addr = getPointerToNamedFunction(F->getName());
|
void *Addr = getPointerToNamedFunction(F->getName());
|
||||||
addGlobalMapping(F, Addr);
|
addGlobalMapping(F, Addr);
|
||||||
|
|
Loading…
Reference in New Issue