Index: src/IceInstrumentation.cpp |
diff --git a/src/IceInstrumentation.cpp b/src/IceInstrumentation.cpp |
index 0cd218abcbdbd7df2507cab8808dbcfdb7db5c20..b816a15d0a38ea5d62f99fe6552382a696f1f5ed 100644 |
--- a/src/IceInstrumentation.cpp |
+++ b/src/IceInstrumentation.cpp |
@@ -118,4 +118,17 @@ void Instrumentation::instrumentInst(LoweringContext &Context) { |
} |
} |
+void Instrumentation::setHasSeenGlobals() { |
+ std::unique_lock<std::mutex> GlobalsLock(GlobalsSeenMutex); |
Jim Stichnoth
2016/07/19 22:39:00
I think this could be simpler:
void Instrumentati
tlively
2016/07/19 23:20:14
Done.
|
+ HasSeenGlobals = true; |
+ GlobalsLock.unlock(); |
+ GlobalsSeenCV.notify_all(); |
+} |
+ |
+LockedPtr<VariableDeclarationList> Instrumentation::getGlobals() { |
+ std::unique_lock<std::mutex> GlobalsLock(GlobalsSeenMutex); |
+ GlobalsSeenCV.wait(GlobalsLock, [&] { return HasSeenGlobals; }); |
Jim Stichnoth
2016/07/19 22:39:00
Instead of default capture, can you capture "this"
tlively
2016/07/19 23:20:14
Done.
|
+ return Ctx->getGlobals(); |
+} |
+ |
} // end of namespace Ice |