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

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

Issue 419773002: Take extra lock in base::WaitableEvent::WaitMany. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "base/synchronization/condition_variable.h" 10 #include "base/synchronization/condition_variable.h"
(...skipping 24 matching lines...) Expand all
35 namespace base { 35 namespace base {
36 36
37 // ----------------------------------------------------------------------------- 37 // -----------------------------------------------------------------------------
38 // This is just an abstract base class for waking the two types of waiters 38 // This is just an abstract base class for waking the two types of waiters
39 // ----------------------------------------------------------------------------- 39 // -----------------------------------------------------------------------------
40 WaitableEvent::WaitableEvent(bool manual_reset, bool initially_signaled) 40 WaitableEvent::WaitableEvent(bool manual_reset, bool initially_signaled)
41 : kernel_(new WaitableEventKernel(manual_reset, initially_signaled)) { 41 : kernel_(new WaitableEventKernel(manual_reset, initially_signaled)) {
42 } 42 }
43 43
44 WaitableEvent::~WaitableEvent() { 44 WaitableEvent::~WaitableEvent() {
45 // TODO(yhirano): Write comment here
yhirano 2014/07/31 11:48:20 I will add a comment tomorrow...
46 base::AutoLock locked(kernel_->lock_);
45 } 47 }
46 48
47 void WaitableEvent::Reset() { 49 void WaitableEvent::Reset() {
48 base::AutoLock locked(kernel_->lock_); 50 base::AutoLock locked(kernel_->lock_);
49 kernel_->signaled_ = false; 51 kernel_->signaled_ = false;
50 } 52 }
51 53
52 void WaitableEvent::Signal() { 54 void WaitableEvent::Signal() {
53 base::AutoLock locked(kernel_->lock_); 55 base::AutoLock locked(kernel_->lock_);
54 56
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 return true; 400 return true;
399 } 401 }
400 } 402 }
401 403
402 return false; 404 return false;
403 } 405 }
404 406
405 // ----------------------------------------------------------------------------- 407 // -----------------------------------------------------------------------------
406 408
407 } // namespace base 409 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698