Fix breakpad compilation issue with clang on Windows
Fix unused variable error. Code that uses the kWaitForHandlerThreadMs constant is inside and ifdef so in some compile configurations constant was unused. Move it where it's used. And do the same with other constants as requested during review. BUG= Change-Id: I4f4c8f36c982092d53438ed6d2a0a97772402d69 Reviewed-on: https://chromium-review.googlesource.com/374378 Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
c9f80bf1a8
commit
a2196179cc
1 changed files with 4 additions and 6 deletions
|
@ -41,12 +41,6 @@
|
||||||
|
|
||||||
namespace google_breakpad {
|
namespace google_breakpad {
|
||||||
|
|
||||||
static const int kWaitForHandlerThreadMs = 60000;
|
|
||||||
static const int kExceptionHandlerThreadInitialStackSize = 64 * 1024;
|
|
||||||
|
|
||||||
// As documented on MSDN, on failure SuspendThread returns (DWORD) -1
|
|
||||||
static const DWORD kFailedToSuspendThread = static_cast<DWORD>(-1);
|
|
||||||
|
|
||||||
// This is passed as the context to the MinidumpWriteDump callback.
|
// This is passed as the context to the MinidumpWriteDump callback.
|
||||||
typedef struct {
|
typedef struct {
|
||||||
AppMemoryList::const_iterator iter;
|
AppMemoryList::const_iterator iter;
|
||||||
|
@ -217,6 +211,7 @@ void ExceptionHandler::Initialize(
|
||||||
// Don't attempt to create the thread if we could not create the semaphores.
|
// Don't attempt to create the thread if we could not create the semaphores.
|
||||||
if (handler_finish_semaphore_ != NULL && handler_start_semaphore_ != NULL) {
|
if (handler_finish_semaphore_ != NULL && handler_start_semaphore_ != NULL) {
|
||||||
DWORD thread_id;
|
DWORD thread_id;
|
||||||
|
const int kExceptionHandlerThreadInitialStackSize = 64 * 1024;
|
||||||
handler_thread_ = CreateThread(NULL, // lpThreadAttributes
|
handler_thread_ = CreateThread(NULL, // lpThreadAttributes
|
||||||
kExceptionHandlerThreadInitialStackSize,
|
kExceptionHandlerThreadInitialStackSize,
|
||||||
ExceptionHandlerThreadMain,
|
ExceptionHandlerThreadMain,
|
||||||
|
@ -353,6 +348,7 @@ ExceptionHandler::~ExceptionHandler() {
|
||||||
// inside DllMain.
|
// inside DllMain.
|
||||||
is_shutdown_ = true;
|
is_shutdown_ = true;
|
||||||
ReleaseSemaphore(handler_start_semaphore_, 1, NULL);
|
ReleaseSemaphore(handler_start_semaphore_, 1, NULL);
|
||||||
|
const int kWaitForHandlerThreadMs = 60000;
|
||||||
WaitForSingleObject(handler_thread_, kWaitForHandlerThreadMs);
|
WaitForSingleObject(handler_thread_, kWaitForHandlerThreadMs);
|
||||||
#else
|
#else
|
||||||
TerminateThread(handler_thread_, 1);
|
TerminateThread(handler_thread_, 1);
|
||||||
|
@ -781,6 +777,8 @@ bool ExceptionHandler::WriteMinidumpForChild(HANDLE child,
|
||||||
EXCEPTION_RECORD ex;
|
EXCEPTION_RECORD ex;
|
||||||
CONTEXT ctx;
|
CONTEXT ctx;
|
||||||
EXCEPTION_POINTERS exinfo = { NULL, NULL };
|
EXCEPTION_POINTERS exinfo = { NULL, NULL };
|
||||||
|
// As documented on MSDN, on failure SuspendThread returns (DWORD) -1
|
||||||
|
const DWORD kFailedToSuspendThread = static_cast<DWORD>(-1);
|
||||||
DWORD last_suspend_count = kFailedToSuspendThread;
|
DWORD last_suspend_count = kFailedToSuspendThread;
|
||||||
HANDLE child_thread_handle = OpenThread(THREAD_GET_CONTEXT |
|
HANDLE child_thread_handle = OpenThread(THREAD_GET_CONTEXT |
|
||||||
THREAD_QUERY_INFORMATION |
|
THREAD_QUERY_INFORMATION |
|
||||||
|
|
Loading…
Reference in a new issue