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

Side by Side Diff: src/base/atomic-utils.h

Issue 1954603002: Move atomic-utils.h into base/ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « src/atomic-utils.h ('k') | src/cancelable-task.h » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project 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 #ifndef V8_ATOMIC_UTILS_H_ 5 #ifndef V8_ATOMIC_UTILS_H_
6 #define V8_ATOMIC_UTILS_H_ 6 #define V8_ATOMIC_UTILS_H_
7 7
8 #include <limits.h> 8 #include <limits.h>
9 9
10 #include "src/base/atomicops.h" 10 #include "src/base/atomicops.h"
11 #include "src/base/macros.h" 11 #include "src/base/macros.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace base {
15 15
16 template <class T> 16 template <class T>
17 class AtomicNumber { 17 class AtomicNumber {
18 public: 18 public:
19 AtomicNumber() : value_(0) {} 19 AtomicNumber() : value_(0) {}
20 explicit AtomicNumber(T initial) : value_(initial) {} 20 explicit AtomicNumber(T initial) : value_(initial) {}
21 21
22 // Returns the newly set value. 22 // Returns the newly set value.
23 V8_INLINE T Increment(T increment) { 23 V8_INLINE T Increment(T increment) {
24 return static_cast<T>(base::Barrier_AtomicIncrement( 24 return static_cast<T>(base::Barrier_AtomicIncrement(
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 return base::Acquire_Load(&bits_); 162 return base::Acquire_Load(&bits_);
163 } 163 }
164 164
165 V8_INLINE base::AtomicWord Mask(E element) const { 165 V8_INLINE base::AtomicWord Mask(E element) const {
166 return static_cast<base::AtomicWord>(1) << element; 166 return static_cast<base::AtomicWord>(1) << element;
167 } 167 }
168 168
169 base::AtomicWord bits_; 169 base::AtomicWord bits_;
170 }; 170 };
171 171
172 } // namespace internal 172 } // namespace base
173 } // namespace v8 173 } // namespace v8
174 174
175 #endif // #define V8_ATOMIC_UTILS_H_ 175 #endif // #define V8_ATOMIC_UTILS_H_
OLDNEW
« no previous file with comments | « src/atomic-utils.h ('k') | src/cancelable-task.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698