diff options
author | ivan.penkov@gmail.com <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2012-09-07 18:01:26 +0000 |
---|---|---|
committer | ivan.penkov@gmail.com <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2012-09-07 18:01:26 +0000 |
commit | d6a10e6fbb6c1cce21b8452addf5f3551fbf3b9a (patch) | |
tree | 788a4dbb60101629c8d823985a6edf5f4143a95f | |
parent | Fix the Linux build on Ubuntu 12.04 LTS (diff) | |
download | breakpad-d6a10e6fbb6c1cce21b8452addf5f3551fbf3b9a.tar.xz |
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
-rw-r--r-- | src/client/windows/crash_generation/crash_generation_server.cc | 9 |
1 files changed, 6 insertions, 3 deletions
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 |