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

Unified Diff: chrome/app/breakpad_win.cc

Issue 283024: Prevent multiple threads from executing the DumpDoneCallback handler... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/breakpad_win.cc
===================================================================
--- chrome/app/breakpad_win.cc (revision 29073)
+++ chrome/app/breakpad_win.cc (working copy)
@@ -134,6 +134,9 @@
std::wstring process_type;
};
+// flag to indicate that we are already handling an exception.
+volatile LONG handling_exception = 0;
+
// This callback is executed when the browser process has crashed, after
// the crash dump has been created. We need to minimize the amount of work
// done here since we have potentially corrupted process. Our job is to
@@ -143,6 +146,12 @@
bool DumpDoneCallback(const wchar_t*, const wchar_t*, void*,
EXCEPTION_POINTERS* ex_info,
MDRawAssertionInfo*, bool) {
+ // Capture every thread except the first one in the sleep. We don't
+ // want multiple threads to concurrently execute the rest of the code.
+ if (::InterlockedCompareExchange(&handling_exception, 1, 0) == 1) {
+ ::Sleep(INFINITE);
Nicolas Sylvain 2009/10/16 22:58:46 why not just return false?
cpu_(ooo_6.6-7.5) 2009/10/17 00:54:19 Because we are in the exception hander still so th
+ }
+
// If the exception is because there was a problem loading a delay-loaded
// module, then show the user a dialog explaining the problem and then exit.
if (DelayLoadFailureExceptionMessageBox(ex_info))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698