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/memory/ref_counted.h directly instead. |
7 // | 7 // |
8 // The implementation includes annotations to avoid some false positives | 8 // The implementation includes annotations to avoid some false positives |
9 // when using data race detection tools. | 9 // when using data race detection tools. |
10 | 10 |
11 #ifndef BASE_ATOMIC_REF_COUNT_H_ | 11 #ifndef BASE_ATOMIC_REF_COUNT_H_ |
12 #define BASE_ATOMIC_REF_COUNT_H_ | 12 #define BASE_ATOMIC_REF_COUNT_H_ |
13 #pragma once | 13 #pragma once |
14 | 14 |
15 #include "base/atomicops.h" | 15 #include "base/atomicops.h" |
16 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 16 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 bool res = (subtle::Acquire_Load(ptr) == 0); | 72 bool res = (subtle::Acquire_Load(ptr) == 0); |
73 if (res) { | 73 if (res) { |
74 ANNOTATE_HAPPENS_AFTER(ptr); | 74 ANNOTATE_HAPPENS_AFTER(ptr); |
75 } | 75 } |
76 return res; | 76 return res; |
77 } | 77 } |
78 | 78 |
79 } // namespace base | 79 } // namespace base |
80 | 80 |
81 #endif // BASE_ATOMIC_REF_COUNT_H_ | 81 #endif // BASE_ATOMIC_REF_COUNT_H_ |
OLD | NEW |