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

Side by Side Diff: base/synchronization/waitable_event_posix.cc

Issue 2020043002: Make WaitableEvent's constructor enum-based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « base/synchronization/waitable_event.h ('k') | base/synchronization/waitable_event_win.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 18 matching lines...) Expand all
29 // from the list. 29 // from the list.
30 // 30 //
31 // Waiting on multiple events is handled by adding a single, synchronous wait to 31 // Waiting on multiple events is handled by adding a single, synchronous wait to
32 // the wait-list of many events. An event passes a pointer to itself when 32 // the wait-list of many events. An event passes a pointer to itself when
33 // firing a waiter and so we can store that pointer to find out which event 33 // firing a waiter and so we can store that pointer to find out which event
34 // triggered. 34 // triggered.
35 // ----------------------------------------------------------------------------- 35 // -----------------------------------------------------------------------------
36 36
37 namespace base { 37 namespace base {
38 38
39 WaitableEvent::WaitableEvent(ResetPolicy reset_policy,
danakj 2016/05/31 20:06:41 Can you group this with the other constructor more
gab 2016/05/31 21:00:13 Done.
40 InitialState initial_state)
41 : WaitableEvent(reset_policy == ResetPolicy::MANUAL,
42 initial_state == InitialState::SIGNALED) {}
43
39 // ----------------------------------------------------------------------------- 44 // -----------------------------------------------------------------------------
40 // This is just an abstract base class for waking the two types of waiters 45 // This is just an abstract base class for waking the two types of waiters
41 // ----------------------------------------------------------------------------- 46 // -----------------------------------------------------------------------------
42 WaitableEvent::WaitableEvent(bool manual_reset, bool initially_signaled) 47 WaitableEvent::WaitableEvent(bool manual_reset, bool initially_signaled)
43 : kernel_(new WaitableEventKernel(manual_reset, initially_signaled)) { 48 : kernel_(new WaitableEventKernel(manual_reset, initially_signaled)) {
44 } 49 }
45 50
46 WaitableEvent::~WaitableEvent() { 51 WaitableEvent::~WaitableEvent() {
47 } 52 }
48 53
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 return true; 413 return true;
409 } 414 }
410 } 415 }
411 416
412 return false; 417 return false;
413 } 418 }
414 419
415 // ----------------------------------------------------------------------------- 420 // -----------------------------------------------------------------------------
416 421
417 } // namespace base 422 } // namespace base
OLDNEW
« no previous file with comments | « base/synchronization/waitable_event.h ('k') | base/synchronization/waitable_event_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698