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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/IceInstrumentation.h ('k') | tests_lit/asan_tests/no_globals.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceInstrumentation.cpp - ICE instrumentation framework -===// 1 //===- subzero/src/IceInstrumentation.cpp - ICE instrumentation framework -===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 case Inst::Unreachable: 111 case Inst::Unreachable:
112 instrumentUnreachable(Context, llvm::cast<InstUnreachable>(Instr)); 112 instrumentUnreachable(Context, llvm::cast<InstUnreachable>(Instr));
113 break; 113 break;
114 default: 114 default:
115 // Only instrument high-level ICE instructions 115 // Only instrument high-level ICE instructions
116 assert(false && "Instrumentation encountered an unexpected instruction"); 116 assert(false && "Instrumentation encountered an unexpected instruction");
117 break; 117 break;
118 } 118 }
119 } 119 }
120 120
121 void Instrumentation::setHasSeenGlobals() {
122 {
123 std::unique_lock<std::mutex> _(GlobalsSeenMutex);
124 HasSeenGlobals = true;
125 }
126 GlobalsSeenCV.notify_all();
127 }
128
129 LockedPtr<VariableDeclarationList> Instrumentation::getGlobals() {
130 std::unique_lock<std::mutex> GlobalsLock(GlobalsSeenMutex);
131 GlobalsSeenCV.wait(GlobalsLock, [this] { return HasSeenGlobals; });
132 return Ctx->getGlobals();
133 }
134
121 } // end of namespace Ice 135 } // end of namespace Ice
OLDNEW
« 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