Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |