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

Side by Side Diff: base/waitable_event_win.cc

Issue 40195: An assert was being hit because WaitableEvent's dtor was calling CloseHandle ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/waitable_event.h ('k') | chrome/common/child_process_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/waitable_event.h" 5 #include "base/waitable_event.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 10 matching lines...) Expand all
21 21
22 WaitableEvent::WaitableEvent(HANDLE handle) 22 WaitableEvent::WaitableEvent(HANDLE handle)
23 : handle_(handle) { 23 : handle_(handle) {
24 CHECK(handle) << "Tried to create WaitableEvent from NULL handle"; 24 CHECK(handle) << "Tried to create WaitableEvent from NULL handle";
25 } 25 }
26 26
27 WaitableEvent::~WaitableEvent() { 27 WaitableEvent::~WaitableEvent() {
28 CloseHandle(handle_); 28 CloseHandle(handle_);
29 } 29 }
30 30
31 HANDLE WaitableEvent::Release() {
32 HANDLE rv = handle_;
33 handle_ = INVALID_HANDLE_VALUE;
34 return rv;
35 }
36
31 void WaitableEvent::Reset() { 37 void WaitableEvent::Reset() {
32 ResetEvent(handle_); 38 ResetEvent(handle_);
33 } 39 }
34 40
35 void WaitableEvent::Signal() { 41 void WaitableEvent::Signal() {
36 SetEvent(handle_); 42 SetEvent(handle_);
37 } 43 }
38 44
39 bool WaitableEvent::IsSignaled() { 45 bool WaitableEvent::IsSignaled() {
40 return TimedWait(TimeDelta::FromMilliseconds(0)); 46 return TimedWait(TimeDelta::FromMilliseconds(0));
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 INFINITE); // no timeout 88 INFINITE); // no timeout
83 if (result < WAIT_OBJECT_0 || result >= WAIT_OBJECT_0 + count) { 89 if (result < WAIT_OBJECT_0 || result >= WAIT_OBJECT_0 + count) {
84 NOTREACHED() << "WaitForMultipleObjects failed: " << GetLastError(); 90 NOTREACHED() << "WaitForMultipleObjects failed: " << GetLastError();
85 return 0; 91 return 0;
86 } 92 }
87 93
88 return result - WAIT_OBJECT_0; 94 return result - WAIT_OBJECT_0;
89 } 95 }
90 96
91 } // namespace base 97 } // namespace base
OLDNEW
« no previous file with comments | « base/waitable_event.h ('k') | chrome/common/child_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698