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

Unified Diff: src/IceInstrumentation.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: Added condition variable and moved synchronization to Instrumentation 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/IceInstrumentation.h
diff --git a/src/IceInstrumentation.h b/src/IceInstrumentation.h
index 32979634a9f363508bed7abb8025544c1de47a09..dcc116686f3ed7f40fa4f14d5eb6edc9829433b9 100644
--- a/src/IceInstrumentation.h
+++ b/src/IceInstrumentation.h
@@ -43,9 +43,11 @@ public:
Instrumentation(GlobalContext *Ctx) : Ctx(Ctx) {}
virtual void instrumentGlobals(VariableDeclarationList &) {}
void instrumentFunc(Cfg *Func);
+ void setHasSeenGlobals();
protected:
virtual void instrumentInst(LoweringContext &Context);
+ LockedPtr<VariableDeclarationList> getGlobals();
private:
virtual bool isInstrumentable(Cfg *) { return true; }
@@ -78,6 +80,11 @@ private:
protected:
GlobalContext *Ctx;
+
+private:
+ bool HasSeenGlobals = false;
+ std::mutex GlobalsSeenMutex;
+ std::condition_variable GlobalsSeenCV;
};
} // end of namespace Ice

Powered by Google App Engine
This is Rietveld 408576698