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

Side by Side Diff: base/atomic_ref_count.h

Issue 1128733002: Update from https://crrev.com/328418 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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/async_socket_io_handler_unittest.cc ('k') | base/base.gyp » ('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) 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 // 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/memory/ref_counted.h directly instead. 6 // counting. Please use base/memory/ref_counted.h directly instead.
7 //
8 // The implementation includes annotations to avoid some false positives
9 // when using data race detection tools.
10 7
11 #ifndef BASE_ATOMIC_REF_COUNT_H_ 8 #ifndef BASE_ATOMIC_REF_COUNT_H_
12 #define BASE_ATOMIC_REF_COUNT_H_ 9 #define BASE_ATOMIC_REF_COUNT_H_
13 10
14 #include "base/atomicops.h" 11 #include "base/atomicops.h"
15 12
16 namespace base { 13 namespace base {
17 14
18 typedef subtle::Atomic32 AtomicRefCount; 15 typedef subtle::Atomic32 AtomicRefCount;
19 16
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // referencing counting, the object will be destroyed, so the reference count 57 // referencing counting, the object will be destroyed, so the reference count
61 // should never be zero. Hence this is generally used for a debug check. 58 // should never be zero. Hence this is generally used for a debug check.
62 inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) { 59 inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) {
63 bool res = (subtle::Acquire_Load(ptr) == 0); 60 bool res = (subtle::Acquire_Load(ptr) == 0);
64 return res; 61 return res;
65 } 62 }
66 63
67 } // namespace base 64 } // namespace base
68 65
69 #endif // BASE_ATOMIC_REF_COUNT_H_ 66 #endif // BASE_ATOMIC_REF_COUNT_H_
OLDNEW
« no previous file with comments | « base/async_socket_io_handler_unittest.cc ('k') | base/base.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698