OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <stdbool.h> |
| 6 |
| 7 #include "base/atomicops_internals_x86_macosx.h" |
| 8 #include "base/logging.h" |
5 #include "base/synchronization/cancellation_flag.h" | 9 #include "base/synchronization/cancellation_flag.h" |
6 | 10 #include "base/threading/platform_thread.h" |
7 #include "base/logging.h" | |
8 | 11 |
9 namespace base { | 12 namespace base { |
10 | 13 |
11 void CancellationFlag::Set() { | 14 void CancellationFlag::Set() { |
12 #if !defined(NDEBUG) | 15 #if !defined(NDEBUG) |
13 DCHECK_EQ(set_on_, PlatformThread::CurrentId()); | 16 DCHECK_EQ(set_on_, PlatformThread::CurrentId()); |
14 #endif | 17 #endif |
15 base::subtle::Release_Store(&flag_, 1); | 18 base::subtle::Release_Store(&flag_, 1); |
16 } | 19 } |
17 | 20 |
18 bool CancellationFlag::IsSet() const { | 21 bool CancellationFlag::IsSet() const { |
19 return base::subtle::Acquire_Load(&flag_) != 0; | 22 return base::subtle::Acquire_Load(&flag_) != 0; |
20 } | 23 } |
21 | 24 |
22 } // namespace base | 25 } // namespace base |
OLD | NEW |