summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-06-14 09:23:33 +0000
committerEd Schouten <ed@FreeBSD.org>2009-06-14 09:23:33 +0000
commit600c6fa13de5c407dc36dbb0ab73807868741ae0 (patch)
tree49817b316c4fdaa56d9d16ebf2555303d1a990e0 /lib/ExecutionEngine
parent93338c197185f946619794ce011ec27b5b6250e2 (diff)
Notes
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/JIT/JIT.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp
index f8ae8844616dc..43995cb0ecd61 100644
--- a/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/lib/ExecutionEngine/JIT/JIT.cpp
@@ -563,6 +563,11 @@ void *JIT::getPointerToFunction(Function *F) {
return Addr; // Check if function already code gen'd
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.
if (F->hasNotBeenReadFromBitcode()) {