Index: src/IceInstrumentation.cpp |
diff --git a/src/IceInstrumentation.cpp b/src/IceInstrumentation.cpp |
index 0cd218abcbdbd7df2507cab8808dbcfdb7db5c20..0709bfce2d3ba370a00b7c4a0cbe7a5cbde1164c 100644 |
--- a/src/IceInstrumentation.cpp |
+++ b/src/IceInstrumentation.cpp |
@@ -118,4 +118,18 @@ void Instrumentation::instrumentInst(LoweringContext &Context) { |
} |
} |
+void Instrumentation::setHasSeenGlobals() { |
+ { |
+ std::unique_lock<std::mutex> _(GlobalsSeenMutex); |
+ HasSeenGlobals = true; |
+ } |
+ GlobalsSeenCV.notify_all(); |
+} |
+ |
+LockedPtr<VariableDeclarationList> Instrumentation::getGlobals() { |
+ std::unique_lock<std::mutex> GlobalsLock(GlobalsSeenMutex); |
+ GlobalsSeenCV.wait(GlobalsLock, [this] { return HasSeenGlobals; }); |
+ return Ctx->getGlobals(); |
+} |
+ |
} // end of namespace Ice |