diff options
author | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-17 01:03:03 +0000 |
---|---|---|
committer | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-17 01:03:03 +0000 |
commit | b4efc650ae68817ff33bd4efab83ffb23d706113 (patch) | |
tree | c87170f18c64ea14c945450e82e8f1c831553817 | |
parent | a762470c2105bb885a53851d2eb5fc4c15606b8b (diff) | |
download | chromium_src-b4efc650ae68817ff33bd4efab83ffb23d706113.zip chromium_src-b4efc650ae68817ff33bd4efab83ffb23d706113.tar.gz chromium_src-b4efc650ae68817ff33bd4efab83ffb23d706113.tar.bz2 |
Prevent multiple threads from executing the DumpDoneCallback handler
- So respawning the browser is more reliable.
BUG=25091
TEST=see bug
Review URL: http://codereview.chromium.org/283024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29364 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/breakpad_win.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc index 11f06b6..1793535 100644 --- a/chrome/app/breakpad_win.cc +++ b/chrome/app/breakpad_win.cc @@ -134,6 +134,9 @@ struct CrashReporterInfo { 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 @@ struct CrashReporterInfo { 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); + } + // 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)) |