Subzero: Fixed deadlock when _start is first function

It was previously the case that instrumentStart in ASanInstrumentation would block until instrumentGlobals had completed. This was because instrumentStart depends on the global redzones having been inserted. However, instrumentGlobals was not called until the first function was popped off the emit queue, and when _start was the first function, it was not placed on the emit queue until after it had been instrumented and lowered. instrumentStart was waiting for instrumentGlobals, which could not happen until instrumentStart completed.

BUG=https://bugs.chromium.org/p/nativeclient/issues/detail?id=4374
R=kschimpf@google.com, stichnot@chromium.org

Review URL: https://codereview.chromium.org/2165493002 .
diff --git a/src/IceASanInstrumentation.h b/src/IceASanInstrumentation.h
index c9095fa..eb75b20 100644
--- a/src/IceASanInstrumentation.h
+++ b/src/IceASanInstrumentation.h
@@ -23,8 +23,6 @@
 #include "IceGlobalInits.h"
 #include "IceInstrumentation.h"
 
-#include <condition_variable>
-
 namespace Ice {
 
 class ASanInstrumentation : public Instrumentation {
@@ -33,9 +31,7 @@
   ASanInstrumentation &operator=(const ASanInstrumentation &) = delete;
 
 public:
-  ASanInstrumentation(GlobalContext *Ctx)
-      : Instrumentation(Ctx), RzNum(0),
-        GlobalsLock(GlobalsMutex, std::defer_lock) {
+  ASanInstrumentation(GlobalContext *Ctx) : Instrumentation(Ctx), RzNum(0) {
     ICE_TLS_INIT_FIELD(LocalDtors);
   }
   void instrumentGlobals(VariableDeclarationList &Globals) override;
@@ -57,8 +53,6 @@
   bool DidProcessGlobals = false;
   SizeT RzGlobalsNum = 0;
   std::mutex GlobalsMutex;
-  std::unique_lock<std::mutex> GlobalsLock;
-  std::condition_variable GlobalsDoneCV;
 };
 } // end of namespace Ice