|
Boost-Commit : |
From: xushiweizh_at_[hidden]
Date: 2008-05-05 10:14:46
Author: xushiwei
Date: 2008-05-05 10:14:46 EDT (Mon, 05 May 2008)
New Revision: 45141
URL: http://svn.boost.org/trac/boost/changeset/45141
Log:
atomic of solaris
Added:
sandbox/memory/boost/memory/winapi/atomic/solaris.hpp (contents, props changed)
Added: sandbox/memory/boost/memory/winapi/atomic/solaris.hpp
==============================================================================
--- (empty file)
+++ sandbox/memory/boost/memory/winapi/atomic/solaris.hpp 2008-05-05 10:14:46 EDT (Mon, 05 May 2008)
@@ -0,0 +1,63 @@
+//
+// boost/memory/winapi/atomic/solaris.hpp (*)
+//
+// Copyright (c) 2004 - 2008 xushiwei (xushiweizh_at_[hidden])
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/memory/index.htm for documentation.
+//
+#ifndef BOOST_MEMORY_WINAPI_ATOMIC_SOLARIS_HPP
+#define BOOST_MEMORY_WINAPI_ATOMIC_SOLARIS_HPP
+
+// -------------------------------------------------------------------------
+
+__forceinline LONG WINAPI InterlockedIncrement(volatile LPLONG lpAddend)
+{
+ return atomic_inc_32_nv(lpAddend);
+}
+
+__forceinline LONG WINAPI InterlockedDecrement(volatile LPLONG lpAddend)
+{
+ return atomic_dec_32_nv(lpAddend);
+}
+
+// -------------------------------------------------------------------------
+
+__forceinline LONG WINAPI InterlockedExchange(volatile LPLONG Target, LONG Value)
+{
+ return atomic_swap_32(Target, Value);
+}
+
+__forceinline PVOID WINAPI InterlockedExchangePointer(volatile PVOID* Target, PVOID Value)
+{
+ return atomic_swap_ptr(Target, Value);
+}
+
+// -------------------------------------------------------------------------
+
+__forceinline LONG WINAPI InterlockedExchangeAdd(volatile LPLONG Addend, LONG Value)
+{
+ return atomic_add_32_nv(Addend, Value) - Value;
+}
+
+// -------------------------------------------------------------------------
+
+__forceinline LONG WINAPI InterlockedCompareExchange(
+ volatile LPLONG Destination, LONG Exchange, LONG Comperand)
+{
+ return atomic_cas_32(Destination, Comperand, Exchange);
+}
+
+__forceinline PVOID WINAPI InterlockedCompareExchangePointer(
+ volatile PVOID* Destination, PVOID Exchange, PVOID Comperand)
+{
+ return atomic_cas_ptr(Destination, Comperand, Exchange);
+}
+
+// -------------------------------------------------------------------------
+// $Log: $
+
+#endif /* BOOST_MEMORY_WINAPI_ATOMIC_SOLARIS_HPP */
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk