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

Side by Side Diff: runtime/vm/atomic.h

Issue 529823002: - Add AtomicOperations::CompareAndSwapWord (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/atomic_android.h » ('j') | runtime/vm/object.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_ATOMIC_H_ 5 #ifndef VM_ATOMIC_H_
6 #define VM_ATOMIC_H_ 6 #define VM_ATOMIC_H_
7 7
8 #include "platform/globals.h"
9
8 #include "vm/allocation.h" 10 #include "vm/allocation.h"
9 11
10 namespace dart { 12 namespace dart {
11 13
12 class AtomicOperations : public AllStatic { 14 class AtomicOperations : public AllStatic {
13 public: 15 public:
14 // Atomically fetch the value at p and increment the value at p. 16 // Atomically fetch the value at p and increment the value at p.
15 // Returns the original value at p. 17 // Returns the original value at p.
16 static uintptr_t FetchAndIncrement(uintptr_t* p); 18 static uintptr_t FetchAndIncrement(uintptr_t* p);
19
20 static uword CompareAndSwapWord(uword* ptr, uword old_value, uword new_value);
17 }; 21 };
18 22
19 23
20 } // namespace dart 24 } // namespace dart
21 25
26 #if defined(TARGET_OS_ANDROID)
27 #include "vm/atomic_android.h"
28 #elif defined(TARGET_OS_LINUX)
29 #include "vm/atomic_linux.h"
30 #elif defined(TARGET_OS_MACOS)
31 #include "vm/atomic_macos.h"
32 #elif defined(TARGET_OS_WINDOWS)
33 #include "vm/atomic_win.h"
34 #else
35 #error Unknown target os.
36 #endif
37
22 #endif // VM_ATOMIC_H_ 38 #endif // VM_ATOMIC_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/atomic_android.h » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698