OLD | NEW |
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 // This is a low level implementation of atomic semantics for reference | 5 // This is a low level implementation of atomic semantics for reference |
6 // counting. Please use base/ref_counted.h directly instead. | 6 // counting. Please use base/ref_counted.h directly instead. |
7 | 7 |
8 #ifndef BASE_ATOMIC_REF_COUNT_H_ | 8 #ifndef BASE_ATOMIC_REF_COUNT_H_ |
9 #define BASE_ATOMIC_REF_COUNT_H_ | 9 #define BASE_ATOMIC_REF_COUNT_H_ |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // Return whether the reference count is zero. With conventional object | 54 // Return whether the reference count is zero. With conventional object |
55 // referencing counting, the object will be destroyed, so the reference count | 55 // referencing counting, the object will be destroyed, so the reference count |
56 // should never be zero. Hence this is generally used for a debug check. | 56 // should never be zero. Hence this is generally used for a debug check. |
57 inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) { | 57 inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) { |
58 return subtle::Acquire_Load(ptr) == 0; | 58 return subtle::Acquire_Load(ptr) == 0; |
59 } | 59 } |
60 | 60 |
61 } // namespace base | 61 } // namespace base |
62 | 62 |
63 #endif // BASE_ATOMIC_REF_COUNT_H_ | 63 #endif // BASE_ATOMIC_REF_COUNT_H_ |
64 | |
OLD | NEW |