mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
After obtaining the lock, look if the function has been codegen'd by
another thread. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73227 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -563,6 +563,11 @@ void *JIT::getPointerToFunction(Function *F) {
|
|||||||
return Addr; // Check if function already code gen'd
|
return Addr; // Check if function already code gen'd
|
||||||
|
|
||||||
MutexGuard locked(lock);
|
MutexGuard locked(lock);
|
||||||
|
|
||||||
|
// Now that this thread owns the lock, check if another thread has already
|
||||||
|
// code gen'd the function.
|
||||||
|
if (void *Addr = getPointerToGlobalIfAvailable(F))
|
||||||
|
return Addr;
|
||||||
|
|
||||||
// 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()) {
|
||||||
|
Reference in New Issue
Block a user