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

Unified Diff: runtime/vm/atomic_macos.h

Issue 529823002: - Add AtomicOperations::CompareAndSwapWord (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/atomic_macos.h
===================================================================
--- runtime/vm/atomic_macos.h (working copy)
+++ runtime/vm/atomic_macos.h (working copy)
@@ -2,19 +2,31 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-#include "platform/globals.h"
-#if defined(TARGET_OS_MACOS)
+#ifndef VM_ATOMIC_MACOS_H_
+#define VM_ATOMIC_MACOS_H_
-#include "vm/atomic.h"
+#if !defined VM_ATOMIC_H_
+#error Do not include atomic_macos.h directly. Use atomic.h instead.
+#endif
+#if !defined(TARGET_OS_MACOS)
+#error This file should only be included on Mac OS X builds.
+#endif
+
namespace dart {
-uintptr_t AtomicOperations::FetchAndIncrement(uintptr_t* p) {
+inline uintptr_t AtomicOperations::FetchAndIncrement(uintptr_t* p) {
return __sync_fetch_and_add(p, 1);
}
+inline uword AtomicOperations::CompareAndSwapWord(uword* ptr,
+ uword old_value,
+ uword new_value) {
+ return __sync_val_compare_and_swap(ptr, old_value, new_value);
+}
+
} // namespace dart
-#endif // defined(TARGET_OS_MACOS)
+#endif // VM_ATOMIC_MACOS_H_
« no previous file with comments | « runtime/vm/atomic_linux.cc ('k') | runtime/vm/atomic_macos.cc » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698