|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r86504 - in trunk: boost/thread boost/thread/csbl boost/thread/csbl/memory boost/thread/detail libs/thread/example libs/thread/test/sync/futures/async libs/thread/test/sync/futures/packaged_task libs/thread/test/sync/futures/promise libs/thread/test/threads/container
From: vicente.botet_at_[hidden]
Date: 2013-10-28 16:08:40
Author: viboes
Date: 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013)
New Revision: 86504
URL: http://svn.boost.org/trac/boost/changeset/86504
Log:
Thread: make use of csbl to make the code more readable and to ensure that it interact well with the std.
Added:
trunk/boost/thread/csbl/deque.hpp (contents, props changed)
trunk/boost/thread/csbl/list.hpp (contents, props changed)
trunk/boost/thread/csbl/memory/
trunk/boost/thread/csbl/memory.hpp (contents, props changed)
trunk/boost/thread/csbl/memory/allocator_arg.hpp (contents, props changed)
trunk/boost/thread/csbl/memory/allocator_traits.hpp (contents, props changed)
trunk/boost/thread/csbl/memory/config.hpp (contents, props changed)
trunk/boost/thread/csbl/memory/default_delete.hpp (contents, props changed)
trunk/boost/thread/csbl/memory/pointer_traits.hpp (contents, props changed)
trunk/boost/thread/csbl/memory/scoped_allocator.hpp (contents, props changed)
trunk/boost/thread/csbl/memory/unique_ptr.hpp (contents, props changed)
Text files modified:
trunk/boost/thread/csbl/deque.hpp | 34 ++++++++++
trunk/boost/thread/csbl/functional.hpp | 24 +++++-
trunk/boost/thread/csbl/list.hpp | 32 ++++++++++
trunk/boost/thread/csbl/memory.hpp | 61 +++++++++++++++++++
trunk/boost/thread/csbl/memory/allocator_arg.hpp | 41 +++++++++++++
trunk/boost/thread/csbl/memory/allocator_traits.hpp | 35 +++++++++++
trunk/boost/thread/csbl/memory/config.hpp | 16 +++++
trunk/boost/thread/csbl/memory/default_delete.hpp | 125 ++++++++++++++++++++++++++++++++++++++++
trunk/boost/thread/csbl/memory/pointer_traits.hpp | 35 +++++++++++
trunk/boost/thread/csbl/memory/scoped_allocator.hpp | 35 +++++++++++
trunk/boost/thread/csbl/memory/unique_ptr.hpp | 106 +++++++++++++++++++++++++++++++++
trunk/boost/thread/csbl/tuple.hpp | 13 ++-
trunk/boost/thread/csbl/vector.hpp | 6 -
trunk/boost/thread/detail/delete.hpp | 1
trunk/boost/thread/detail/function_wrapper.hpp | 7 -
trunk/boost/thread/detail/memory.hpp | 123 ++-------------------------------------
trunk/boost/thread/future.hpp | 50 +++++++++++----
trunk/boost/thread/sync_queue.hpp | 4
trunk/boost/thread/thread_pool.hpp | 18 ++---
trunk/libs/thread/example/executor.cpp | 8 +-
trunk/libs/thread/example/thread_pool.cpp | 8 +-
trunk/libs/thread/test/sync/futures/async/async_pass.cpp | 24 +++---
trunk/libs/thread/test/sync/futures/packaged_task/use_allocator_pass.cpp | 2
trunk/libs/thread/test/sync/futures/promise/set_rvalue_at_thread_exit_pass.cpp | 13 ++-
trunk/libs/thread/test/sync/futures/promise/use_allocator_pass.cpp | 6
trunk/libs/thread/test/threads/container/thread_ptr_list_pass.cpp | 6
trunk/libs/thread/test/threads/container/thread_vector_pass.cpp | 5
27 files changed, 644 insertions(+), 194 deletions(-)
Added: trunk/boost/thread/csbl/deque.hpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/boost/thread/csbl/deque.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -0,0 +1,34 @@
+// Copyright (C) 2013 Vicente J. Botet Escriba
+//
+// 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)
+//
+// 2013/10 Vicente J. Botet Escriba
+// Creation.
+
+#ifndef BOOST_CSBL_DEQUE_HPP
+#define BOOST_CSBL_DEQUE_HPP
+
+#include <boost/config.hpp>
+
+#if defined BOOST_NO_CXX11_HDR_DEQUE || defined BOOST_NO_CXX11_RVALUE_REFERENCES
+#include <boost/container/deque.hpp>
+#else
+#include <deque>
+#endif
+
+namespace boost
+{
+ namespace csbl
+ {
+#if defined BOOST_NO_CXX11_HDR_DEQUE || defined BOOST_NO_CXX11_RVALUE_REFERENCES
+ using ::boost::container::deque;
+
+#else
+ using ::std::deque;
+
+#endif
+
+ }
+}
+#endif // header
Modified: trunk/boost/thread/csbl/functional.hpp
==============================================================================
--- trunk/boost/thread/csbl/functional.hpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/boost/thread/csbl/functional.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -11,22 +11,34 @@
#include <boost/config.hpp>
-#ifdef BOOST_NO_CXX11_HDR_FUNCTIONAL
-#include <boost/function.hpp>
-#else
#include <functional>
+
+#if defined BOOST_NO_CXX11_HDR_FUNCTIONAL || defined BOOST_NO_CXX11_RVALUE_REFERENCES
+#include <boost/function.hpp>
#endif
namespace boost
{
namespace csbl
{
-#ifdef BOOST_NO_CXX11_HDR_FUNCTIONAL
+#if defined BOOST_NO_CXX11_HDR_FUNCTIONAL || defined BOOST_NO_CXX11_RVALUE_REFERENCES
using ::boost::function;
-
#else
+ // D.8.1, base (deprecated):
+ // 20.9.3, reference_wrapper:
+ // 20.9.4, arithmetic operations:
+ // 20.9.5, comparisons:
+ // 20.9.6, logical operations:
+ // 20.9.7, bitwise operations:
+ // 20.9.8, negators:
+ // 20.9.9, bind:
+ // D.9, binders (deprecated):
+ // D.8.2.1, adaptors (deprecated):
+ // D.8.2.2, adaptors (deprecated):
+ // 20.9.10, member function adaptors:
+ // 20.9.11 polymorphic function wrappers:
using ::std::function;
-
+ // 20.9.12, hash function primary template:
#endif
}
Added: trunk/boost/thread/csbl/list.hpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/boost/thread/csbl/list.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -0,0 +1,32 @@
+// Copyright (C) 2013 Vicente J. Botet Escriba
+//
+// 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)
+//
+// 2013/10 Vicente J. Botet Escriba
+// Creation.
+
+#ifndef BOOST_CSBL_LIST_HPP
+#define BOOST_CSBL_LIST_HPP
+
+#include <boost/config.hpp>
+
+#if defined BOOST_NO_CXX11_HDR_LIST || defined BOOST_NO_CXX11_RVALUE_REFERENCES
+#include <boost/container/list.hpp>
+#else
+#include <list>
+#endif
+
+namespace boost
+{
+ namespace csbl
+ {
+#if defined BOOST_NO_CXX11_HDR_LIST || defined BOOST_NO_CXX11_RVALUE_REFERENCES
+ using ::boost::container::list;
+#else
+ using ::std::list;
+#endif
+
+ }
+}
+#endif // header
Added: trunk/boost/thread/csbl/memory.hpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/boost/thread/csbl/memory.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -0,0 +1,61 @@
+// Copyright (C) 2013 Vicente J. Botet Escriba
+//
+// 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)
+//
+// 2013/10 Vicente J. Botet Escriba
+// Creation.
+
+#ifndef BOOST_CSBL_MEMORY_HPP
+#define BOOST_CSBL_MEMORY_HPP
+
+// 20.7.2 Header <memory> synopsis
+
+// 20.7.3, pointer traits
+#include <boost/thread/csbl/memory/pointer_traits.hpp>
+
+// 20.7.4, pointer safety
+// 20.7.5, pointer alignment function
+
+// 20.7.6, allocator argument tag
+#include <boost/thread/csbl/memory/allocator_arg.hpp>
+
+// 20.7.8, allocator traits
+#include <boost/thread/csbl/memory/allocator_traits.hpp>
+
+// 20.7.7, uses_allocator
+#include <boost/thread/csbl/memory/scoped_allocator.hpp>
+
+// 20.7.9, the default allocator:
+namespace boost
+{
+ namespace csbl
+ {
+ using ::std::allocator;
+ }
+}
+// 20.7.10, raw storage iterator:
+// 20.7.11, temporary buffers:
+// 20.7.12, specialized algorithms:
+
+// 20.8.1 class template unique_ptr:
+// default_delete
+#include <boost/thread/csbl/memory/default_delete.hpp>
+#include <boost/thread/csbl/memory/unique_ptr.hpp>
+
+// 20.8.2.1, class bad_weak_ptr:
+// 20.8.2.2, class template shared_ptr:
+// 20.8.2.2.6, shared_ptr creation
+// 20.8.2.2.7, shared_ptr comparisons:
+// 20.8.2.2.8, shared_ptr specialized algorithms:
+// 20.8.2.2.9, shared_ptr casts:
+// 20.8.2.2.10, shared_ptr get_deleter:
+// 20.8.2.2.11, shared_ptr I/O:
+// 20.8.2.3, class template weak_ptr:
+// 20.8.2.3.6, weak_ptr specialized algorithms:
+// 20.8.2.3.7, class template owner_less:
+// 20.8.2.4, class template enable_shared_from_this:
+// 20.8.2.5, shared_ptr atomic access:
+// 20.8.2.6 hash support
+
+#endif // header
Added: trunk/boost/thread/csbl/memory/allocator_arg.hpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/boost/thread/csbl/memory/allocator_arg.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -0,0 +1,41 @@
+// Copyright (C) 2013 Vicente J. Botet Escriba
+//
+// 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)
+//
+// 2013/10 Vicente J. Botet Escriba
+// Creation.
+
+#ifndef BOOST_CSBL_MEMORY_ALLOCATOR_ARG_HPP
+#define BOOST_CSBL_MEMORY_ALLOCATOR_ARG_HPP
+
+#include <boost/thread/csbl/memory/config.hpp>
+
+// 20.7.6, allocator argument tag
+#if defined BOOST_NO_CXX11_ALLOCATOR
+#include <boost/container/scoped_allocator.hpp>
+
+namespace boost
+{
+ namespace csbl
+ {
+ using ::boost::container::allocator_arg_t;
+ using ::boost::container::allocator_arg;
+ }
+}
+#else
+namespace boost
+{
+ namespace csbl
+ {
+ using ::std::allocator_arg_t;
+ using ::std::allocator_arg;
+ }
+}
+#endif // BOOST_NO_CXX11_ALLOCATOR
+namespace boost
+{
+ using ::boost::csbl::allocator_arg_t;
+ using ::boost::csbl::allocator_arg;
+}
+#endif // header
Added: trunk/boost/thread/csbl/memory/allocator_traits.hpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/boost/thread/csbl/memory/allocator_traits.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -0,0 +1,35 @@
+// Copyright (C) 2013 Vicente J. Botet Escriba
+//
+// 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)
+//
+// 2013/10 Vicente J. Botet Escriba
+// Creation.
+
+#ifndef BOOST_CSBL_MEMORY_ALLOCATOR_TRAITS_HPP
+#define BOOST_CSBL_MEMORY_ALLOCATOR_TRAITS_HPP
+
+#include <boost/thread/csbl/memory/config.hpp>
+
+// 20.7.8, allocator traits
+#if defined BOOST_NO_CXX11_ALLOCATOR
+#include <boost/container/allocator_traits.hpp>
+
+namespace boost
+{
+ namespace csbl
+ {
+ using ::boost::container::allocator_traits;
+ }
+}
+#else
+namespace boost
+{
+ namespace csbl
+ {
+ using ::std::allocator_traits;
+ }
+}
+#endif // BOOST_NO_CXX11_POINTER_TRAITS
+
+#endif // header
Added: trunk/boost/thread/csbl/memory/config.hpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/boost/thread/csbl/memory/config.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -0,0 +1,16 @@
+// Copyright (C) 2013 Vicente J. Botet Escriba
+//
+// 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)
+//
+// 2013/10 Vicente J. Botet Escriba
+// Creation.
+
+#ifndef BOOST_CSBL_MEMORY_CONFIG_HPP
+#define BOOST_CSBL_MEMORY_CONFIG_HPP
+
+#include <boost/config.hpp>
+
+#include <memory>
+
+#endif // header
Added: trunk/boost/thread/csbl/memory/default_delete.hpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/boost/thread/csbl/memory/default_delete.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -0,0 +1,125 @@
+// Copyright (C) 2013 Vicente J. Botet Escriba
+//
+// 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)
+//
+// 2013/10 Vicente J. Botet Escriba
+// Creation.
+
+#ifndef BOOST_CSBL_MEMORY_DEFAULT_DELETE_HPP
+#define BOOST_CSBL_MEMORY_DEFAULT_DELETE_HPP
+
+#include <boost/thread/csbl/memory/config.hpp>
+
+// 20.8.1 class template unique_ptr:
+// default_delete
+
+#if defined BOOST_NO_CXX11_SMART_PTR
+#include <boost/thread/csbl/memory/pointer_traits.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_scalar.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/static_assert.hpp>
+
+namespace boost
+{
+ namespace csbl
+ {
+ namespace detail
+ {
+
+ template <class _Ptr1, class _Ptr2,
+ bool = is_same<typename remove_cv<typename pointer_traits<_Ptr1>::element_type>::type,
+ typename remove_cv<typename pointer_traits<_Ptr2>::element_type>::type
+ >::value
+ >
+ struct same_or_less_cv_qualified_imp
+ : is_convertible<_Ptr1, _Ptr2>
+ {};
+
+ template <class _Ptr1, class _Ptr2>
+ struct same_or_less_cv_qualified_imp<_Ptr1, _Ptr2, false>
+ : false_type
+ {};
+
+ template <class _Ptr1, class _Ptr2, bool = is_scalar<_Ptr1>::value &&
+ !is_pointer<_Ptr1>::value>
+ struct same_or_less_cv_qualified
+ : same_or_less_cv_qualified_imp<_Ptr1, _Ptr2>
+ {};
+
+ template <class _Ptr1, class _Ptr2>
+ struct same_or_less_cv_qualified<_Ptr1, _Ptr2, true>
+ : false_type
+ {};
+
+ }
+ template <class T>
+ struct BOOST_SYMBOL_VISIBLE default_delete
+ {
+#ifndef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+ BOOST_SYMBOL_VISIBLE
+ BOOST_CONSTEXPR default_delete() = default;
+#else
+ BOOST_SYMBOL_VISIBLE
+ BOOST_CONSTEXPR default_delete() BOOST_NOEXCEPT
+ {}
+#endif
+ template <class U>
+ BOOST_SYMBOL_VISIBLE
+ default_delete(const default_delete<U>&,
+ typename enable_if<is_convertible<U*, T*> >::type* = 0) BOOST_NOEXCEPT
+ {}
+ BOOST_SYMBOL_VISIBLE
+ void operator() (T* ptr) const BOOST_NOEXCEPT
+ {
+ BOOST_STATIC_ASSERT_MSG(sizeof(T) > 0, "default_delete can not delete incomplete type");
+ delete ptr;
+ }
+ };
+
+ template <class T>
+ struct BOOST_SYMBOL_VISIBLE default_delete<T[]>
+ {
+ public:
+#ifndef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
+ BOOST_SYMBOL_VISIBLE
+ BOOST_CONSTEXPR default_delete() = default;
+#else
+ BOOST_SYMBOL_VISIBLE
+ BOOST_CONSTEXPR default_delete() BOOST_NOEXCEPT
+ {}
+#endif
+ template <class U>
+ BOOST_SYMBOL_VISIBLE
+ default_delete(const default_delete<U[]>&,
+ typename enable_if<detail::same_or_less_cv_qualified<U*, T*> >::type* = 0) BOOST_NOEXCEPT
+ {}
+ template <class U>
+ BOOST_SYMBOL_VISIBLE
+ void operator() (U* ptr,
+ typename enable_if<detail::same_or_less_cv_qualified<U*, T*> >::type* = 0) const BOOST_NOEXCEPT
+ {
+ BOOST_STATIC_ASSERT_MSG(sizeof(T) > 0, "default_delete can not delete incomplete type");
+ delete [] ptr;
+ }
+ };
+ }
+}
+#else
+namespace boost
+{
+ namespace csbl
+ {
+ using ::std::default_delete;
+ }
+}
+#endif // defined BOOST_NO_CXX11_SMART_PTR
+
+namespace boost
+{
+ using ::boost::csbl::default_delete;
+}
+#endif // header
Added: trunk/boost/thread/csbl/memory/pointer_traits.hpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/boost/thread/csbl/memory/pointer_traits.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -0,0 +1,35 @@
+// Copyright (C) 2013 Vicente J. Botet Escriba
+//
+// 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)
+//
+// 2013/10 Vicente J. Botet Escriba
+// Creation.
+
+#ifndef BOOST_CSBL_MEMORY_POINTER_TRAITS_HPP
+#define BOOST_CSBL_MEMORY_POINTER_TRAITS_HPP
+
+#include <boost/thread/csbl/memory/config.hpp>
+
+// 20.7.3, pointer traits
+#if defined BOOST_NO_CXX11_ALLOCATOR
+#include <boost/intrusive/pointer_traits.hpp>
+
+namespace boost
+{
+ namespace csbl
+ {
+ using ::boost::intrusive::pointer_traits;
+ }
+}
+#else
+namespace boost
+{
+ namespace csbl
+ {
+ using ::std::pointer_traits;
+ }
+}
+#endif // BOOST_NO_CXX11_ALLOCATOR
+
+#endif // header
Added: trunk/boost/thread/csbl/memory/scoped_allocator.hpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/boost/thread/csbl/memory/scoped_allocator.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -0,0 +1,35 @@
+// Copyright (C) 2013 Vicente J. Botet Escriba
+//
+// 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)
+//
+// 2013/10 Vicente J. Botet Escriba
+// Creation.
+
+#ifndef BOOST_CSBL_MEMORY_SCOPED_ALLOCATOR_HPP
+#define BOOST_CSBL_MEMORY_SCOPED_ALLOCATOR_HPP
+
+#include <boost/thread/csbl/memory/config.hpp>
+
+// 20.7.7, uses_allocator
+#if defined BOOST_NO_CXX11_ALLOCATOR
+#include <boost/container/scoped_allocator.hpp>
+
+namespace boost
+{
+ namespace csbl
+ {
+ using ::boost::container::uses_allocator;
+ }
+}
+#else
+namespace boost
+{
+ namespace csbl
+ {
+ using ::std::uses_allocator;
+ }
+}
+#endif // BOOST_NO_CXX11_POINTER_TRAITS
+
+#endif // header
Added: trunk/boost/thread/csbl/memory/unique_ptr.hpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/boost/thread/csbl/memory/unique_ptr.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -0,0 +1,106 @@
+// Copyright (C) 2013 Vicente J. Botet Escriba
+//
+// 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)
+//
+// 2013/10 Vicente J. Botet Escriba
+// Creation.
+
+#ifndef BOOST_CSBL_MEMORY_UNIQUE_PTR_HPP
+#define BOOST_CSBL_MEMORY_UNIQUE_PTR_HPP
+
+#include <boost/thread/csbl/memory/config.hpp>
+
+// 20.8.1 class template unique_ptr:
+#if defined BOOST_NO_CXX11_SMART_PTR
+#include <boost/thread/csbl/memory/default_delete.hpp>
+
+#include <boost/interprocess/smart_ptr/unique_ptr.hpp>
+
+namespace boost
+{
+ namespace csbl
+ {
+ template <class T, class D = default_delete<T> > class unique_ptr :
+ public ::boost::interprocess::unique_ptr<T,D>
+ {
+ typedef ::boost::interprocess::unique_ptr<T,D> base_type;
+ BOOST_MOVABLE_BUT_NOT_COPYABLE(unique_ptr)
+ protected:
+ //typedef typename base_type::nat nat;
+ //typedef typename base_type::nullptr_t nullptr_t;
+ struct nat {int for_bool;};
+ struct nat2 {int for_nullptr;};
+ typedef int nat2::*nullptr_t;
+
+ public:
+ typedef typename base_type::element_type element_type;
+ typedef typename base_type::deleter_type deleter_type;
+ typedef typename base_type::pointer pointer;
+
+ unique_ptr() : base_type()
+ {}
+ explicit unique_ptr(pointer p): base_type(p)
+ {}
+ unique_ptr(pointer p
+ ,typename interprocess::ipcdetail::if_<interprocess::ipcdetail::is_reference<D>
+ ,D
+ ,typename interprocess::ipcdetail::add_reference<const D>::type>::type d)
+ : base_type(p, d)
+ {}
+ unique_ptr(BOOST_RV_REF(unique_ptr) u)
+ : base_type(boost::move(static_cast<base_type&>(u)))
+ {}
+ template <class U, class E>
+ unique_ptr(BOOST_RV_REF_BEG unique_ptr<U, E> BOOST_RV_REF_END u,
+ typename interprocess::ipcdetail::enable_if_c<
+ interprocess::ipcdetail::is_convertible<typename unique_ptr<U, E>::pointer, pointer>::value &&
+ interprocess::ipcdetail::is_convertible<E, D>::value &&
+ (
+ !interprocess::ipcdetail::is_reference<D>::value ||
+ interprocess::ipcdetail::is_same<D, E>::value
+ )
+ ,
+ nat
+ >::type = nat())
+ : base_type(boost::move(static_cast< ::boost::interprocess::unique_ptr<U,E>&>(u)))
+ {}
+ unique_ptr& operator=(BOOST_RV_REF(unique_ptr) u)
+ {
+ this->base_type.operator=(boost::move(static_cast<base_type&>(u)));
+ return *this;
+ }
+ template <class U, class E>
+ unique_ptr& operator=(BOOST_RV_REF_BEG unique_ptr<U, E> BOOST_RV_REF_END u)
+ {
+ this->base_type.template operator=<U,E>(boost::move(static_cast< ::boost::interprocess::unique_ptr<U,E>&>(u)));
+ return *this;
+ }
+ unique_ptr& operator=(nullptr_t t)
+ {
+ this->base_type.operator=(t);
+ return *this;
+ }
+ void swap(unique_ptr& u)
+ {
+ this->base_type.swap(u);
+ }
+ };
+ template <class T, class D>
+ class unique_ptr<T[], D> :
+ public ::boost::interprocess::unique_ptr<T[],D>
+ {
+
+ };
+ }
+}
+#else
+namespace boost
+{
+ namespace csbl
+ {
+ using ::std::unique_ptr;
+ }
+}
+#endif // BOOST_NO_CXX11_SMART_PTR
+#endif // header
Modified: trunk/boost/thread/csbl/tuple.hpp
==============================================================================
--- trunk/boost/thread/csbl/tuple.hpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/boost/thread/csbl/tuple.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -11,7 +11,7 @@
#include <boost/config.hpp>
-#ifdef BOOST_NO_CXX11_HDR_TUPLE
+#if defined BOOST_NO_CXX11_HDR_TUPLE || defined BOOST_NO_CXX11_RVALUE_REFERENCES
#include <boost/tuple/tuple.hpp>
#else
#include <tuple>
@@ -21,12 +21,17 @@
{
namespace csbl
{
-#ifdef BOOST_NO_CXX11_HDR_TUPLE
+#if defined BOOST_NO_CXX11_HDR_TUPLE || defined BOOST_NO_CXX11_RVALUE_REFERENCES
using ::boost::tuple;
-
#else
+ // 20.4.2, class template tuple:
using ::std::tuple;
-
+ // 20.4.2.4, tuple creation functions:
+ // 20.4.2.5, tuple helper classes:
+ // 20.4.2.6, element access:
+ // 20.4.2.7, relational operators:
+ // 20.4.2.8, allocator-related traits
+ // 20.4.2.9, specialized algorithms:
#endif
}
Modified: trunk/boost/thread/csbl/vector.hpp
==============================================================================
--- trunk/boost/thread/csbl/vector.hpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/boost/thread/csbl/vector.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -11,7 +11,7 @@
#include <boost/config.hpp>
-#ifdef BOOST_NO_CXX11_HDR_VECTOR
+#if defined BOOST_NO_CXX11_HDR_VECTOR || defined BOOST_NO_CXX11_RVALUE_REFERENCES
#include <boost/container/vector.hpp>
#else
#include <vector>
@@ -21,12 +21,10 @@
{
namespace csbl
{
-#ifdef BOOST_NO_CXX11_HDR_VECTOR
+#if defined BOOST_NO_CXX11_HDR_VECTOR || defined BOOST_NO_CXX11_RVALUE_REFERENCES
using ::boost::container::vector;
-
#else
using ::std::vector;
-
#endif
}
Modified: trunk/boost/thread/detail/delete.hpp
==============================================================================
--- trunk/boost/thread/detail/delete.hpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/boost/thread/detail/delete.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -15,6 +15,7 @@
* BOOST_THREAD_DELETE_COPY_ASSIGN deletes the copy assignment when the compiler supports it or
* makes it private.
*/
+
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
CLASS(CLASS const&) = delete; \
Modified: trunk/boost/thread/detail/function_wrapper.hpp
==============================================================================
--- trunk/boost/thread/detail/function_wrapper.hpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/boost/thread/detail/function_wrapper.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -14,7 +14,7 @@
#include <boost/thread/detail/memory.hpp>
#include <boost/thread/detail/move.hpp>
-#include <boost/interprocess/smart_ptr/unique_ptr.hpp>
+#include <boost/thread/csbl/memory/unique_ptr.hpp>
#include <memory>
#include <functional>
@@ -32,8 +32,8 @@
{
}
};
- //typedef boost::interprocess::unique_ptr<impl_base, boost::default_delete<impl_base> > impl_base_type;
- impl_base* impl;
+ typedef boost::csbl::unique_ptr<impl_base> impl_base_type;
+ impl_base_type impl;
template <typename F>
struct impl_type: impl_base
{
@@ -74,7 +74,6 @@
}
~function_wrapper()
{
- delete impl;
}
function_wrapper& operator=(BOOST_THREAD_RV_REF(function_wrapper) other) BOOST_NOEXCEPT
Modified: trunk/boost/thread/detail/memory.hpp
==============================================================================
--- trunk/boost/thread/detail/memory.hpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/boost/thread/detail/memory.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -13,14 +13,11 @@
#define BOOST_THREAD_DETAIL_MEMORY_HPP
#include <boost/config.hpp>
-#include <boost/container/allocator_traits.hpp>
-#include <boost/container/scoped_allocator.hpp>
-#include <boost/type_traits/remove_cv.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-#include <boost/type_traits/is_scalar.hpp>
-#include <boost/type_traits/is_pointer.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/static_assert.hpp>
+
+#include <boost/thread/csbl/memory/pointer_traits.hpp>
+#include <boost/thread/csbl/memory/allocator_arg.hpp>
+#include <boost/thread/csbl/memory/allocator_traits.hpp>
+#include <boost/thread/csbl/memory/scoped_allocator.hpp>
namespace boost
{
@@ -29,7 +26,7 @@
template <class _Alloc>
class allocator_destructor
{
- typedef container::allocator_traits<_Alloc> alloc_traits;
+ typedef csbl::allocator_traits<_Alloc> alloc_traits;
public:
typedef typename alloc_traits::pointer pointer;
typedef typename alloc_traits::size_type size_type;
@@ -47,111 +44,5 @@
}
};
} //namespace thread_detail
-
- typedef container::allocator_arg_t allocator_arg_t;
- BOOST_CONSTEXPR_OR_CONST allocator_arg_t allocator_arg = {};
-
- template <class T, class Alloc>
- struct uses_allocator: public container::uses_allocator<T, Alloc>
- {
- };
-
- template <class Ptr>
- struct pointer_traits
- {
- typedef Ptr pointer;
-// typedef <details> element_type;
-// typedef <details> difference_type;
-
-// template <class U> using rebind = <details>;
-//
-// static pointer pointer_to(<details>);
- };
-
- template <class T>
- struct pointer_traits<T*>
- {
- typedef T* pointer;
- typedef T element_type;
- typedef ptrdiff_t difference_type;
-
-// template <class U> using rebind = U*;
-//
-// static pointer pointer_to(<details>) noexcept;
- };
-
-
- namespace thread_detail {
- template <class _Ptr1, class _Ptr2,
- bool = is_same<typename remove_cv<typename pointer_traits<_Ptr1>::element_type>::type,
- typename remove_cv<typename pointer_traits<_Ptr2>::element_type>::type
- >::value
- >
- struct same_or_less_cv_qualified_imp
- : is_convertible<_Ptr1, _Ptr2> {};
-
- template <class _Ptr1, class _Ptr2>
- struct same_or_less_cv_qualified_imp<_Ptr1, _Ptr2, false>
- : false_type {};
-
- template <class _Ptr1, class _Ptr2, bool = is_scalar<_Ptr1>::value &&
- !is_pointer<_Ptr1>::value>
- struct same_or_less_cv_qualified
- : same_or_less_cv_qualified_imp<_Ptr1, _Ptr2> {};
-
- template <class _Ptr1, class _Ptr2>
- struct same_or_less_cv_qualified<_Ptr1, _Ptr2, true>
- : false_type {};
-
- }
- template <class T>
- struct BOOST_SYMBOL_VISIBLE default_delete
- {
- #ifndef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
- BOOST_SYMBOL_VISIBLE
- BOOST_CONSTEXPR default_delete() = default;
- #else
- BOOST_SYMBOL_VISIBLE
- BOOST_CONSTEXPR default_delete() BOOST_NOEXCEPT {}
- #endif
- template <class U>
- BOOST_SYMBOL_VISIBLE
- default_delete(const default_delete<U>&,
- typename enable_if<is_convertible<U*, T*> >::type* = 0) BOOST_NOEXCEPT {}
- BOOST_SYMBOL_VISIBLE
- void operator() (T* ptr) const BOOST_NOEXCEPT
- {
- BOOST_STATIC_ASSERT_MSG(sizeof(T) > 0, "default_delete can not delete incomplete type");
- delete ptr;
- }
- };
-
- template <class T>
- struct BOOST_SYMBOL_VISIBLE default_delete<T[]>
- {
- public:
- #ifndef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
- BOOST_SYMBOL_VISIBLE
- BOOST_CONSTEXPR default_delete() = default;
- #else
- BOOST_SYMBOL_VISIBLE
- BOOST_CONSTEXPR default_delete() BOOST_NOEXCEPT {}
- #endif
- template <class U>
- BOOST_SYMBOL_VISIBLE
- default_delete(const default_delete<U[]>&,
- typename enable_if<thread_detail::same_or_less_cv_qualified<U*, T*> >::type* = 0) BOOST_NOEXCEPT {}
- template <class U>
- BOOST_SYMBOL_VISIBLE
- void operator() (U* ptr,
- typename enable_if<thread_detail::same_or_less_cv_qualified<U*, T*> >::type* = 0) const BOOST_NOEXCEPT
- {
- BOOST_STATIC_ASSERT_MSG(sizeof(T) > 0, "default_delete can not delete incomplete type");
- delete [] ptr;
- }
- };
-
-} // namespace boost
-
-
+}
#endif // BOOST_THREAD_DETAIL_MEMORY_HPP
Modified: trunk/boost/thread/future.hpp
==============================================================================
--- trunk/boost/thread/future.hpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/boost/thread/future.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -54,6 +54,10 @@
#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
#include <boost/thread/detail/memory.hpp>
+#include <boost/container/scoped_allocator.hpp>
+#if ! defined BOOST_NO_CXX11_ALLOCATOR
+#include <memory>
+#endif
#endif
#include <boost/utility/result_of.hpp>
@@ -2453,17 +2457,27 @@
}
};
-
+}
#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
- namespace container
+namespace boost { namespace container {
+ template <class R, class Alloc>
+ struct uses_allocator< ::boost::promise<R> , Alloc> : true_type
{
- template <class R, class Alloc>
- struct uses_allocator<promise<R> , Alloc> : true_type
- {
- };
- }
+ };
+}}
+#if ! defined BOOST_NO_CXX11_ALLOCATOR
+namespace std {
+ template <class R, class Alloc>
+ struct uses_allocator< ::boost::promise<R> , Alloc> : true_type
+ {
+ };
+}
+#endif
#endif
+namespace boost
+{
+
BOOST_THREAD_DCL_MOVABLE_BEG(T) promise<T> BOOST_THREAD_DCL_MOVABLE_END
namespace detail
@@ -3378,16 +3392,26 @@
task->set_wait_callback(f,this);
}
};
-
+}
#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
- namespace container
+namespace boost { namespace container {
+ template <class R, class Alloc>
+ struct uses_allocator< ::boost::packaged_task<R> , Alloc> : true_type
{
- template <class R, class Alloc>
- struct uses_allocator<packaged_task<R>, Alloc>
- : public true_type {};
- }
+ };
+}}
+#if ! defined BOOST_NO_CXX11_ALLOCATOR
+namespace std {
+ template <class R, class Alloc>
+ struct uses_allocator< ::boost::packaged_task<R> , Alloc> : true_type
+ {
+ };
+}
+#endif
#endif
+namespace boost
+{
BOOST_THREAD_DCL_MOVABLE_BEG(T) packaged_task<T> BOOST_THREAD_DCL_MOVABLE_END
namespace detail
Modified: trunk/boost/thread/sync_queue.hpp
==============================================================================
--- trunk/boost/thread/sync_queue.hpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/boost/thread/sync_queue.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -20,7 +20,7 @@
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/thread/sync_bounded_queue.hpp>
-#include <boost/container/deque.hpp>
+#include <boost/thread/csbl/deque.hpp>
#include <boost/config/abi_prefix.hpp>
@@ -73,7 +73,7 @@
mutable mutex mtx_;
condition_variable not_empty_;
size_type waiting_empty_;
- boost::container::deque<ValueType> data_;
+ csbl::deque<ValueType> data_;
bool closed_;
inline bool empty(unique_lock<mutex>& ) const BOOST_NOEXCEPT
Modified: trunk/boost/thread/thread_pool.hpp
==============================================================================
--- trunk/boost/thread/thread_pool.hpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/boost/thread/thread_pool.hpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -24,11 +24,13 @@
//#include <functional>
//#endif
-#if defined BOOST_NO_CXX11_RVALUE_REFERENCES
-#include <boost/container/vector.hpp>
-#else
-#include <vector>
-#endif
+#include <boost/thread/csbl/vector.hpp>
+
+//#if defined BOOST_NO_CXX11_RVALUE_REFERENCES
+//#include <boost/container/vector.hpp>
+//#else
+//#include <vector>
+//#endif
#include <boost/config/abi_prefix.hpp>
@@ -43,11 +45,7 @@
/// the kind of stored threads are scoped threads to ensure that the threads are joined.
/// A move aware vector type
typedef scoped_thread<> thread_t;
-#if defined BOOST_NO_CXX11_RVALUE_REFERENCES
- typedef container::vector<thread_t> thread_vector;
-#else
- typedef std::vector<thread_t> thread_vector;
-#endif
+ typedef csbl::vector<thread_t> thread_vector;
/// the thread safe work queue
sync_queue<work > work_queue;
Modified: trunk/libs/thread/example/executor.cpp
==============================================================================
--- trunk/libs/thread/example/executor.cpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/libs/thread/example/executor.cpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -25,7 +25,7 @@
<< boost::this_thread::get_id() << " P2" << BOOST_THREAD_END_LOG;
}
-void push(boost::container::deque<boost::thread_detail::work> &data_, BOOST_THREAD_RV_REF(boost::thread_detail::work) closure)
+void push(boost::csbl::deque<boost::thread_detail::work> &data_, BOOST_THREAD_RV_REF(boost::thread_detail::work) closure)
{
try
{
@@ -61,7 +61,7 @@
}
template <typename Closure>
-void submit(boost::container::deque<boost::thread_detail::work> &data_, BOOST_THREAD_FWD_REF(Closure) closure)
+void submit(boost::csbl::deque<boost::thread_detail::work> &data_, BOOST_THREAD_FWD_REF(Closure) closure)
{
BOOST_THREAD_LOG
<< boost::this_thread::get_id() << " <MAIN" << BOOST_THREAD_END_LOG;
@@ -87,7 +87,7 @@
{
boost::thread_detail::work f(&p1);
- boost::container::deque<boost::thread_detail::work> data_;
+ boost::csbl::deque<boost::thread_detail::work> data_;
data_.push_back(boost::move(f));
data_.push_back(boost::thread_detail::work(&p1));
submit(data_, &p1);
@@ -103,7 +103,7 @@
<< " ERRORRRRR exception thrown" << BOOST_THREAD_END_LOG;
}
- typedef boost::container::vector<boost::thread> thread_vector;
+ typedef boost::csbl::vector<boost::thread> thread_vector;
thread_vector threads;
}
Modified: trunk/libs/thread/example/thread_pool.cpp
==============================================================================
--- trunk/libs/thread/example/thread_pool.cpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/libs/thread/example/thread_pool.cpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -24,7 +24,7 @@
<< boost::this_thread::get_id() << " P2" << BOOST_THREAD_END_LOG;
}
-void push(boost::container::deque<boost::thread_detail::work> &data_, BOOST_THREAD_RV_REF(boost::thread_detail::work) closure)
+void push(boost::csbl::deque<boost::thread_detail::work> &data_, BOOST_THREAD_RV_REF(boost::thread_detail::work) closure)
{
try
{
@@ -60,7 +60,7 @@
}
template <typename Closure>
-void submit(boost::container::deque<boost::thread_detail::work> &data_, BOOST_THREAD_FWD_REF(Closure) closure)
+void submit(boost::csbl::deque<boost::thread_detail::work> &data_, BOOST_THREAD_FWD_REF(Closure) closure)
{
BOOST_THREAD_LOG
<< boost::this_thread::get_id() << " <MAIN" << BOOST_THREAD_END_LOG;
@@ -86,7 +86,7 @@
{
boost::thread_detail::work f(&p1);
- boost::container::deque<boost::thread_detail::work> data_;
+ boost::csbl::deque<boost::thread_detail::work> data_;
data_.push_back(boost::move(f));
data_.push_back(boost::thread_detail::work(&p1));
submit(data_, &p1);
@@ -102,7 +102,7 @@
<< " ERRORRRRR exception thrown" << BOOST_THREAD_END_LOG;
}
- typedef boost::container::vector<boost::thread> thread_vector;
+ typedef boost::csbl::vector<boost::thread> thread_vector;
thread_vector threads;
}
Modified: trunk/libs/thread/test/sync/futures/async/async_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/futures/async/async_pass.cpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/libs/thread/test/sync/futures/async/async_pass.cpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -34,7 +34,7 @@
#include <boost/thread/future.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/detail/memory.hpp>
-#include <boost/interprocess/smart_ptr/unique_ptr.hpp>
+#include <boost/thread/csbl/memory/unique_ptr.hpp>
#include <memory>
#include <boost/detail/lightweight_test.hpp>
#ifdef BOOST_THREAD_PROVIDES_EXECUTORS
@@ -122,10 +122,10 @@
boost::this_thread::sleep_for(ms(200));
}
-boost::interprocess::unique_ptr<int, boost::default_delete<int> > f3_0()
+boost::csbl::unique_ptr<int> f3_0()
{
boost::this_thread::sleep_for(ms(200));
- boost::interprocess::unique_ptr<int, boost::default_delete<int> > r( (new int(3)));
+ boost::csbl::unique_ptr<int> r( (new int(3)));
return boost::move(r);
}
MoveOnly f3_1()
@@ -135,14 +135,14 @@
return boost::move(r);
}
-boost::interprocess::unique_ptr<int, boost::default_delete<int> > f3(int i)
+boost::csbl::unique_ptr<int> f3(int i)
{
boost::this_thread::sleep_for(ms(200));
- return boost::interprocess::unique_ptr<int, boost::default_delete<int> >(new int(i));
+ return boost::csbl::unique_ptr<int>(new int(i));
}
-boost::interprocess::unique_ptr<int, boost::default_delete<int> > f4(
- BOOST_THREAD_RV_REF_BEG boost::interprocess::unique_ptr<int, boost::default_delete<int> > BOOST_THREAD_RV_REF_END p
+boost::csbl::unique_ptr<int> f4(
+ BOOST_THREAD_RV_REF_BEG boost::csbl::unique_ptr<int> BOOST_THREAD_RV_REF_END p
)
{
boost::this_thread::sleep_for(ms(200));
@@ -611,7 +611,7 @@
{
try
{
- boost::future<boost::interprocess::unique_ptr<int, boost::default_delete<int> > > f = boost::async(&f3_0);
+ boost::future<boost::csbl::unique_ptr<int> > f = boost::async(&f3_0);
boost::this_thread::sleep_for(ms(300));
Clock::time_point t0 = Clock::now();
BOOST_TEST(*f.get() == 3);
@@ -635,7 +635,7 @@
{
try
{
- boost::future<boost::interprocess::unique_ptr<int, boost::default_delete<int> > > f = boost::async(boost::launch::async, &f3, 3);
+ boost::future<boost::csbl::unique_ptr<int> > f = boost::async(boost::launch::async, &f3, 3);
boost::this_thread::sleep_for(ms(300));
Clock::time_point t0 = Clock::now();
BOOST_TEST(*f.get() == 3);
@@ -657,7 +657,7 @@
{
try
{
- boost::future<boost::interprocess::unique_ptr<int, boost::default_delete<int> > > f = boost::async(&f3, 3);
+ boost::future<boost::csbl::unique_ptr<int> > f = boost::async(&f3, 3);
boost::this_thread::sleep_for(ms(300));
Clock::time_point t0 = Clock::now();
BOOST_TEST(*f.get() == 3);
@@ -682,7 +682,7 @@
{
try
{
- boost::future<boost::interprocess::unique_ptr<int, boost::default_delete<int> > > f = boost::async(boost::launch::async, &f4, boost::interprocess::unique_ptr<int, boost::default_delete<int> >(new int(3)));
+ boost::future<boost::csbl::unique_ptr<int> > f = boost::async(boost::launch::async, &f4, boost::csbl::unique_ptr<int>(new int(3)));
boost::this_thread::sleep_for(ms(300));
Clock::time_point t0 = Clock::now();
BOOST_TEST(*f.get() == 3);
@@ -704,7 +704,7 @@
{
try
{
- boost::future<boost::interprocess::unique_ptr<int, boost::default_delete<int> > > f = boost::async(&f4, boost::interprocess::unique_ptr<int, boost::default_delete<int> >(new int(3)));
+ boost::future<boost::csbl::unique_ptr<int> > f = boost::async(&f4, boost::csbl::unique_ptr<int>(new int(3)));
boost::this_thread::sleep_for(ms(300));
Clock::time_point t0 = Clock::now();
BOOST_TEST(*f.get() == 3);
Modified: trunk/libs/thread/test/sync/futures/packaged_task/use_allocator_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/futures/packaged_task/use_allocator_pass.cpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/libs/thread/test/sync/futures/packaged_task/use_allocator_pass.cpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -38,7 +38,7 @@
int main()
{
- BOOST_STATIC_ASSERT_MSG((boost::uses_allocator<boost::packaged_task<BOOST_THREAD_DETAIL_SIGNATURE>, test_allocator<double> >::value), "");
+ BOOST_STATIC_ASSERT_MSG((boost::csbl::uses_allocator<boost::packaged_task<BOOST_THREAD_DETAIL_SIGNATURE>, test_allocator<double> >::value), "");
return boost::report_errors();
}
Modified: trunk/libs/thread/test/sync/futures/promise/set_rvalue_at_thread_exit_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/futures/promise/set_rvalue_at_thread_exit_pass.cpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/libs/thread/test/sync/futures/promise/set_rvalue_at_thread_exit_pass.cpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -23,21 +23,22 @@
#include <boost/thread/future.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/thread/detail/memory.hpp>
-#include <boost/interprocess/smart_ptr/unique_ptr.hpp>
+//#include <boost/interprocess/smart_ptr/unique_ptr.hpp>
+#include <boost/thread/csbl/memory/unique_ptr.hpp>
-//void func(boost::promise<boost::interprocess::unique_ptr<int, boost::default_delete<int> > > p)
-boost::promise<boost::interprocess::unique_ptr<int, boost::default_delete<int> > > p;
+//void func(boost::promise<boost::csbl::unique_ptr<int> > p)
+boost::promise<boost::csbl::unique_ptr<int> > p;
void func()
{
- boost::interprocess::unique_ptr<int, boost::default_delete<int> > uptr(new int(5));
+ boost::csbl::unique_ptr<int> uptr(new int(5));
p.set_value_at_thread_exit(boost::move(uptr));
}
int main()
{
{
- //boost::promise<boost::interprocess::unique_ptr<int, boost::default_delete<int>> > p;
- boost::future<boost::interprocess::unique_ptr<int, boost::default_delete<int> > > f = p.get_future();
+ //boost::promise<boost::csbl::unique_ptr<int> > > p;
+ boost::future<boost::csbl::unique_ptr<int> > f = p.get_future();
//boost::thread(func, boost::move(p)).detach();
boost::thread(func).detach();
BOOST_TEST(*f.get() == 5);
Modified: trunk/libs/thread/test/sync/futures/promise/use_allocator_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/futures/promise/use_allocator_pass.cpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/libs/thread/test/sync/futures/promise/use_allocator_pass.cpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -30,9 +30,9 @@
int main()
{
- BOOST_STATIC_ASSERT_MSG((boost::uses_allocator<boost::promise<int>, test_allocator<int> >::value), "");
- BOOST_STATIC_ASSERT_MSG((boost::uses_allocator<boost::promise<int&>, test_allocator<int&> >::value), "");
- BOOST_STATIC_ASSERT_MSG((boost::uses_allocator<boost::promise<void>, test_allocator<void> >::value), "");
+ BOOST_STATIC_ASSERT_MSG((boost::csbl::uses_allocator<boost::promise<int>, test_allocator<int> >::value), "");
+ BOOST_STATIC_ASSERT_MSG((boost::csbl::uses_allocator<boost::promise<int&>, test_allocator<int&> >::value), "");
+ BOOST_STATIC_ASSERT_MSG((boost::csbl::uses_allocator<boost::promise<void>, test_allocator<void> >::value), "");
return boost::report_errors();
}
Modified: trunk/libs/thread/test/threads/container/thread_ptr_list_pass.cpp
==============================================================================
--- trunk/libs/thread/test/threads/container/thread_ptr_list_pass.cpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/libs/thread/test/threads/container/thread_ptr_list_pass.cpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -8,7 +8,7 @@
#include <boost/config.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
-#include <boost/container/list.hpp>
+#include <boost/thread/csbl/list.hpp>
//#include <boost/interprocess/smart_ptr/shared_ptr.hpp>
#include <boost/smart_ptr.hpp>
#include <iostream>
@@ -58,7 +58,7 @@
{
typedef boost::shared_ptr<boost::thread > thread_ptr;
//typedef boost::interprocess::shared_ptr<boost::thread, std::allocator<boost::thread>, default_delete<boost::thread> > thread_ptr;
- typedef boost::container::list<thread_ptr > thread_ptr_list;
+ typedef boost::csbl::list<thread_ptr > thread_ptr_list;
thread_ptr_list threads;
for (int i = 0; i < 10; ++i)
{
@@ -76,7 +76,7 @@
{
typedef boost::shared_ptr<boost::thread > thread_ptr;
//typedef boost::interprocess::shared_ptr<boost::thread, std::allocator<boost::thread>, default_delete<boost::thread> > thread_ptr;
- typedef boost::container::list<thread_ptr > thread_ptr_list;
+ typedef boost::csbl::list<thread_ptr > thread_ptr_list;
thread_ptr_list threads;
for (int i = 0; i < 10; ++i)
{
Modified: trunk/libs/thread/test/threads/container/thread_vector_pass.cpp
==============================================================================
--- trunk/libs/thread/test/threads/container/thread_vector_pass.cpp Mon Oct 28 13:16:50 2013 (r86503)
+++ trunk/libs/thread/test/threads/container/thread_vector_pass.cpp 2013-10-28 16:08:39 EDT (Mon, 28 Oct 2013) (r86504)
@@ -7,7 +7,7 @@
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
-#include <boost/container/vector.hpp>
+#include <boost/thread/csbl/vector.hpp>
#include <iostream>
#include <boost/detail/lightweight_test.hpp>
#include <boost/static_assert.hpp>
@@ -50,7 +50,7 @@
int main()
{
- typedef boost::container::vector<boost::thread> thread_vector;
+ typedef boost::csbl::vector<boost::thread> thread_vector;
{
thread_vector threads;
threads.reserve(10);
@@ -92,5 +92,6 @@
interrupt_all(threads);
join_all(threads);
}
+
return boost::report_errors();
}
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