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

Side by Side Diff: src/inspector/Atomics.h

Issue 2340763003: [inspector] replaced inspector/Atomics.h with base atomicops.h (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | src/inspector/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_INSPECTOR_ATOMICS_H_
6 #define V8_INSPECTOR_ATOMICS_H_
7
8 #include <stdint.h>
9
10 #if defined(_MSC_VER)
11 #include <windows.h>
12 #endif
13
14 namespace v8_inspector {
15
16 #if defined(_MSC_VER)
17
18 inline int atomicIncrement(int volatile* addend) {
19 return InterlockedIncrement(reinterpret_cast<long volatile*>(addend));
20 }
21
22 #else
23
24 inline int atomicAdd(int volatile* addend, int increment) {
25 return __sync_add_and_fetch(addend, increment);
26 }
27 inline int atomicIncrement(int volatile* addend) {
28 return atomicAdd(addend, 1);
29 }
30
31 #endif
32
33 } // namespace v8_inspector
34
35 #endif // V8_INSPECTOR_ATOMICS_H_
OLDNEW
« no previous file with comments | « no previous file | src/inspector/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698