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

Side by Side Diff: base/atomic_ref_count.h

Issue 1992005: Update dynamic annotations and move them to base/third_party (Closed)
Patch Set: rebased Created 10 years, 7 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
« no previous file with comments | « base/allocator/allocator.gyp ('k') | base/base.gypi » ('j') | 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) 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 // 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 13
14 #include "base/atomicops.h" 14 #include "base/atomicops.h"
15 #include "base/dynamic_annotations.h" 15 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
16 16
17 namespace base { 17 namespace base {
18 18
19 typedef subtle::Atomic32 AtomicRefCount; 19 typedef subtle::Atomic32 AtomicRefCount;
20 20
21 // Increment a reference count by "increment", which must exceed 0. 21 // Increment a reference count by "increment", which must exceed 0.
22 inline void AtomicRefCountIncN(volatile AtomicRefCount *ptr, 22 inline void AtomicRefCountIncN(volatile AtomicRefCount *ptr,
23 AtomicRefCount increment) { 23 AtomicRefCount increment) {
24 subtle::NoBarrier_AtomicIncrement(ptr, increment); 24 subtle::NoBarrier_AtomicIncrement(ptr, increment);
25 } 25 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 bool res = (subtle::Acquire_Load(ptr) == 0); 71 bool res = (subtle::Acquire_Load(ptr) == 0);
72 if (res) { 72 if (res) {
73 ANNOTATE_HAPPENS_AFTER(ptr); 73 ANNOTATE_HAPPENS_AFTER(ptr);
74 } 74 }
75 return res; 75 return res;
76 } 76 }
77 77
78 } // namespace base 78 } // namespace base
79 79
80 #endif // BASE_ATOMIC_REF_COUNT_H_ 80 #endif // BASE_ATOMIC_REF_COUNT_H_
OLDNEW
« no previous file with comments | « base/allocator/allocator.gyp ('k') | base/base.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698