|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r85604 - in branches/release: boost boost/atomic boost/atomic/detail libs/atomic libs/atomic/build libs/atomic/test
From: andrey.semashev_at_[hidden]
Date: 2013-09-08 09:55:41
Author: andysem
Date: 2013-09-08 09:55:41 EDT (Sun, 08 Sep 2013)
New Revision: 85604
URL: http://svn.boost.org/trac/boost/changeset/85604
Log:
Merged recent changes from trunk.
Properties modified:
branches/release/boost/atomic/ (props changed)
branches/release/boost/atomic.hpp (contents, props changed)
branches/release/libs/atomic/ (props changed)
Text files modified:
branches/release/boost/atomic.hpp | 2
branches/release/boost/atomic/detail/gcc-armv6plus.hpp | 79 ++++++++++++++++++++-------------------
branches/release/boost/atomic/detail/lockpool.hpp | 18 +++------
branches/release/boost/atomic/detail/platform.hpp | 5 ++
branches/release/libs/atomic/build/Jamfile.v2 | 2 +
branches/release/libs/atomic/test/Jamfile.v2 | 4 +-
6 files changed, 56 insertions(+), 54 deletions(-)
Modified: branches/release/boost/atomic.hpp
==============================================================================
--- branches/release/boost/atomic.hpp Sun Sep 8 05:50:12 2013 (r85603)
+++ branches/release/boost/atomic.hpp 2013-09-08 09:55:41 EDT (Sun, 08 Sep 2013) (r85604)
@@ -11,7 +11,7 @@
#include <boost/atomic/atomic.hpp>
-#ifdef BOOST_ATOMIC_HAS_PRAGMA_ONCE
+#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
Modified: branches/release/boost/atomic/detail/gcc-armv6plus.hpp
==============================================================================
--- branches/release/boost/atomic/detail/gcc-armv6plus.hpp Sun Sep 8 05:50:12 2013 (r85603)
+++ branches/release/boost/atomic/detail/gcc-armv6plus.hpp 2013-09-08 09:55:41 EDT (Sun, 08 Sep 2013) (r85604)
@@ -66,29 +66,27 @@
// to annotate the conditional instructions. These are ignored in other modes (e.g. v6),
// so they can always be present.
-#if defined(__thumb__) && !defined(__ARM_ARCH_7A__)
-// FIXME also other v7 variants.
+#if defined(__thumb__) && !defined(__thumb2__)
#define BOOST_ATOMIC_ARM_ASM_START(TMPREG) "adr " #TMPREG ", 1f\n" "bx " #TMPREG "\n" ".arm\n" ".align 4\n" "1: "
#define BOOST_ATOMIC_ARM_ASM_END(TMPREG) "adr " #TMPREG ", 1f + 1\n" "bx " #TMPREG "\n" ".thumb\n" ".align 2\n" "1: "
-
#else
// The tmpreg is wasted in this case, which is non-optimal.
#define BOOST_ATOMIC_ARM_ASM_START(TMPREG)
#define BOOST_ATOMIC_ARM_ASM_END(TMPREG)
#endif
-#if defined(__ARM_ARCH_7A__)
-// FIXME ditto.
+#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7S__)
#define BOOST_ATOMIC_ARM_DMB "dmb\n"
#else
#define BOOST_ATOMIC_ARM_DMB "mcr\tp15, 0, r0, c7, c10, 5\n"
#endif
inline void
-arm_barrier(void)
+arm_barrier(void) BOOST_NOEXCEPT
{
int brtmp;
- __asm__ __volatile__ (
+ __asm__ __volatile__
+ (
BOOST_ATOMIC_ARM_ASM_START(%0)
BOOST_ATOMIC_ARM_DMB
BOOST_ATOMIC_ARM_ASM_END(%0)
@@ -97,56 +95,59 @@
}
inline void
-platform_fence_before(memory_order order)
+platform_fence_before(memory_order order) BOOST_NOEXCEPT
{
- switch(order) {
- case memory_order_release:
- case memory_order_acq_rel:
- case memory_order_seq_cst:
- arm_barrier();
- case memory_order_consume:
- default:;
+ switch(order)
+ {
+ case memory_order_release:
+ case memory_order_acq_rel:
+ case memory_order_seq_cst:
+ arm_barrier();
+ case memory_order_consume:
+ default:;
}
}
inline void
-platform_fence_after(memory_order order)
+platform_fence_after(memory_order order) BOOST_NOEXCEPT
{
- switch(order) {
- case memory_order_acquire:
- case memory_order_acq_rel:
- case memory_order_seq_cst:
- arm_barrier();
- default:;
+ switch(order)
+ {
+ case memory_order_acquire:
+ case memory_order_acq_rel:
+ case memory_order_seq_cst:
+ arm_barrier();
+ default:;
}
}
inline void
-platform_fence_before_store(memory_order order)
+platform_fence_before_store(memory_order order) BOOST_NOEXCEPT
{
platform_fence_before(order);
}
inline void
-platform_fence_after_store(memory_order order)
+platform_fence_after_store(memory_order order) BOOST_NOEXCEPT
{
if (order == memory_order_seq_cst)
arm_barrier();
}
inline void
-platform_fence_after_load(memory_order order)
+platform_fence_after_load(memory_order order) BOOST_NOEXCEPT
{
platform_fence_after(order);
}
template<typename T>
inline bool
-platform_cmpxchg32(T & expected, T desired, volatile T * ptr)
+platform_cmpxchg32(T & expected, T desired, volatile T * ptr) BOOST_NOEXCEPT
{
int success;
int tmp;
- __asm__ (
+ __asm__ __volatile__
+ (
BOOST_ATOMIC_ARM_ASM_START(%2)
"mov %1, #0\n" // success = 0
"ldrex %0, %3\n" // expected' = *(&i)
@@ -163,7 +164,7 @@
: "r" (expected), // %4
"r" (desired) // %5
: "cc"
- );
+ );
return success;
}
@@ -174,13 +175,14 @@
inline void
atomic_thread_fence(memory_order order)
{
- switch(order) {
- case memory_order_acquire:
- case memory_order_release:
- case memory_order_acq_rel:
- case memory_order_seq_cst:
- atomics::detail::arm_barrier();
- default:;
+ switch(order)
+ {
+ case memory_order_acquire:
+ case memory_order_release:
+ case memory_order_acq_rel:
+ case memory_order_seq_cst:
+ atomics::detail::arm_barrier();
+ default:;
}
}
@@ -194,9 +196,8 @@
class atomic_flag
{
private:
- atomic_flag(const atomic_flag &) /* = delete */ ;
- atomic_flag & operator=(const atomic_flag &) /* = delete */ ;
uint32_t v_;
+
public:
BOOST_CONSTEXPR atomic_flag(void) BOOST_NOEXCEPT : v_(0) {}
@@ -220,6 +221,9 @@
atomics::detail::platform_fence_after(order);
return expected;
}
+
+ BOOST_DELETED_FUNCTION(atomic_flag(const atomic_flag &))
+ BOOST_DELETED_FUNCTION(atomic_flag& operator=(const atomic_flag &))
};
#define BOOST_ATOMIC_FLAG_LOCK_FREE 2
@@ -249,4 +253,3 @@
#endif /* !defined(BOOST_ATOMIC_FORCE_FALLBACK) */
#endif
-
Modified: branches/release/boost/atomic/detail/lockpool.hpp
==============================================================================
--- branches/release/boost/atomic/detail/lockpool.hpp Sun Sep 8 05:50:12 2013 (r85603)
+++ branches/release/boost/atomic/detail/lockpool.hpp 2013-09-08 09:55:41 EDT (Sun, 08 Sep 2013) (r85604)
@@ -9,7 +9,7 @@
#include <boost/atomic/detail/config.hpp>
#ifndef BOOST_ATOMIC_FLAG_LOCK_FREE
-#include <boost/thread/mutex.hpp>
+#include <boost/smart_ptr/detail/lightweight_mutex.hpp>
#endif
#ifdef BOOST_HAS_PRAGMA_ONCE
@@ -25,21 +25,15 @@
class lockpool
{
public:
- typedef mutex lock_type;
- class scoped_lock
+ typedef boost::detail::lightweight_mutex lock_type;
+ class scoped_lock :
+ public lock_type::scoped_lock
{
- private:
- lock_type& mtx_;
+ typedef lock_type::scoped_lock base_type;
public:
- explicit
- scoped_lock(const volatile void * addr) : mtx_(get_lock_for(addr))
- {
- mtx_.lock();
- }
- ~scoped_lock()
+ explicit scoped_lock(const volatile void * addr) : base_type(get_lock_for(addr))
{
- mtx_.unlock();
}
BOOST_DELETED_FUNCTION(scoped_lock(scoped_lock const&))
Modified: branches/release/boost/atomic/detail/platform.hpp
==============================================================================
--- branches/release/boost/atomic/detail/platform.hpp Sun Sep 8 05:50:12 2013 (r85603)
+++ branches/release/boost/atomic/detail/platform.hpp 2013-09-08 09:55:41 EDT (Sun, 08 Sep 2013) (r85604)
@@ -38,7 +38,10 @@
// I don't know how complete it is.
#elif defined(__GNUC__) && (defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
|| defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
- || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_7A__))
+ || defined(__ARM_ARCH_6K__) \
+ || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
+ || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
+ || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7S__))
#include <boost/atomic/detail/gcc-armv6plus.hpp>
Modified: branches/release/libs/atomic/build/Jamfile.v2
==============================================================================
--- branches/release/libs/atomic/build/Jamfile.v2 Sun Sep 8 05:50:12 2013 (r85603)
+++ branches/release/libs/atomic/build/Jamfile.v2 2013-09-08 09:55:41 EDT (Sun, 08 Sep 2013) (r85604)
@@ -11,9 +11,11 @@
: requirements
<threading>multi
<link>shared:<define>BOOST_ATOMIC_DYN_LINK=1
+ <link>static:<define>BOOST_ATOMIC_STATIC_LINK=1
<define>BOOST_ATOMIC_SOURCE
: usage-requirements
<link>shared:<define>BOOST_ATOMIC_DYN_LINK=1
+ <link>static:<define>BOOST_ATOMIC_STATIC_LINK=1
: source-location ../src
;
Modified: branches/release/libs/atomic/test/Jamfile.v2
==============================================================================
--- branches/release/libs/atomic/test/Jamfile.v2 Sun Sep 8 05:50:12 2013 (r85603)
+++ branches/release/libs/atomic/test/Jamfile.v2 2013-09-08 09:55:41 EDT (Sun, 08 Sep 2013) (r85604)
@@ -12,8 +12,8 @@
project boost/atomic/test
: requirements
<threading>multi
- <library>../../thread/build//boost_thread
- <library>/boost/atomic//boost_atomic/<link>static
+ <library>/boost/thread//boost_thread
+ <library>/boost/atomic//boost_atomic
;
test-suite atomic
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