From d6a10e6fbb6c1cce21b8452addf5f3551fbf3b9a Mon Sep 17 00:00:00 2001 From: "ivan.penkov@gmail.com" Date: Fri, 7 Sep 2012 18:01:26 +0000 Subject: Fix of a race condition during Crash Generation Server startup https://breakpad.appspot.com/445002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1031 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/windows/crash_generation/crash_generation_server.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/windows/crash_generation/crash_generation_server.cc b/src/client/windows/crash_generation/crash_generation_server.cc index e67025eb..8f6f986d 100644 --- a/src/client/windows/crash_generation/crash_generation_server.cc +++ b/src/client/windows/crash_generation/crash_generation_server.cc @@ -217,7 +217,7 @@ bool CrashGenerationServer::Start() { // Event to signal the client connection and pipe reads and writes. overlapped_.hEvent = CreateEvent(NULL, // Security descriptor. TRUE, // Manual reset. - FALSE, // Initially signaled. + FALSE, // Initially nonsignaled. NULL); // Name. if (!overlapped_.hEvent) { return false; @@ -247,10 +247,13 @@ bool CrashGenerationServer::Start() { // Kick-start the state machine. This will initiate an asynchronous wait // for client connections. - HandleInitialState(); + if (!SetEvent(overlapped_.hEvent)) { + server_state_ = IPC_SERVER_STATE_ERROR; + return false; + } // If we are in error state, it's because we failed to start listening. - return server_state_ != IPC_SERVER_STATE_ERROR; + return true; } // If the server thread serving clients ever gets into the -- cgit v1.2.1