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

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: 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/IceGlobalContext.h ('k') | src/IceInstrumentation.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstrumentation.h
diff --git a/src/IceInstrumentation.h b/src/IceInstrumentation.h
index 32979634a9f363508bed7abb8025544c1de47a09..2392f9607d23ebec5d83c91ebcc39452807fef27 100644
--- a/src/IceInstrumentation.h
+++ b/src/IceInstrumentation.h
@@ -30,6 +30,8 @@
#include "IceDefs.h"
+#include <condition_variable>
+
namespace Ice {
class LoweringContext;
@@ -41,11 +43,14 @@ class Instrumentation {
public:
Instrumentation(GlobalContext *Ctx) : Ctx(Ctx) {}
+ virtual ~Instrumentation() = default;
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 +83,11 @@ private:
protected:
GlobalContext *Ctx;
+
+private:
+ bool HasSeenGlobals = false;
+ std::mutex GlobalsSeenMutex;
+ std::condition_variable GlobalsSeenCV;
};
} // end of namespace Ice
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceInstrumentation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698