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

Unified Diff: src/IceGlobalContext.h

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: 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
Index: src/IceGlobalContext.h
diff --git a/src/IceGlobalContext.h b/src/IceGlobalContext.h
index 2d60f4845466f879ebc50a407ca021edab29a01f..4788423ec988bba9f296ed6513e129c048d0fbb4 100644
--- a/src/IceGlobalContext.h
+++ b/src/IceGlobalContext.h
@@ -482,6 +482,12 @@ public:
return LockedPtr<StringPool>(Strings.get(), &StringsLock);
}
+ LockedPtr<VariableDeclarationList> getGlobals() {
+ return LockedPtr<VariableDeclarationList>(&Globals, &InitAllocLock);
+ }
+
+ bool getGlobalsReceived() { return GlobalsReceived; }
+
/// Number of function blocks that can be queued before waiting for
/// translation
/// threads to consume.
@@ -500,6 +506,7 @@ private:
// Managed by getInitializerAllocator()
mutable GlobalLockType InitAllocLock;
VariableDeclarationList Globals;
+ std::atomic<bool> GlobalsReceived;
ICE_CACHELINE_BOUNDARY;
// Managed by getDestructors()
@@ -612,6 +619,7 @@ private:
LockedPtr<VariableDeclarationList> _(&Globals, &InitAllocLock);
if (Globls != nullptr) {
Globals.merge(Globls.get());
+ GlobalsReceived = true;
}
}

Powered by Google App Engine
This is Rietveld 408576698