Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: src/IceInstrumentation.cpp

Issue 2165493002: Subzero: Fixed deadlock with _start but no globals (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Moved an include to the proper file Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInstrumentation.h ('k') | tests_lit/asan_tests/no_globals.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/IceInstrumentation.h ('k') | tests_lit/asan_tests/no_globals.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698