2
0
mirror of https://github.com/boostorg/thread.git synced 2026-02-03 21:52:07 +00:00

Compare commits

...

9 Commits

Author SHA1 Message Date
Vicente J. Botet Escriba
f25bc8bbab Merge branch 'develop' 2015-04-18 11:56:34 +02:00
Vicente J. Botet Escriba
5c442e068c update compliance. 2015-04-18 07:10:43 +02:00
Vicente J. Botet Escriba
0bed674233 ref #11192- boost::future<>::then() with an executor doesn't compile when the callback returns a future 2015-04-18 07:04:50 +02:00
Vicente J. Botet Escriba
66193b0d38 Test with generic lambdas. 2015-04-17 18:31:34 +02:00
Vicente J. Botet Escriba
45c9a1d7fd ref #11192- boost::future<>::then() with an executor doesn't compile when the callback returns a future 2015-04-17 18:30:49 +02:00
Niall Douglas
0d8ddfe378 Merge pull request #51 from MarcelRaad/patch-1
Respect BOOST_USE_WINDOWS_H again
2015-04-03 17:11:17 +01:00
Vicente J. Botet Escriba
74f479d5c9 Fix non_copyable class in queue/dequeue view tests. 2015-03-29 19:34:28 +02:00
Vicente J. Botet Escriba
dbf793e7eb Don't execute test for launch::deferred if BOOST_THREAD_PROVIDES_VARIADIC_THREAD is not defined. 2015-03-29 19:28:05 +02:00
Marcel Raad
b5c6f760c5 Respect BOOST_USE_WINDOWS_H again
With the GetTickCount64 and WinRT fixes, the Windows API functions were always re-declared regardless of BOOST_USE_WINDOWS_H. This breaks clang-cl, which complains about conflicting definitions.
2015-03-26 13:43:44 +01:00
13 changed files with 249 additions and 36 deletions

View File

@@ -1,13 +1,15 @@
[/
(C) Copyright 2011-2013 Vicente J. Botet Escriba.
(C) Copyright 2011-2015 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).
]
[section:compliance Conformance and Extension]
[////////////////////////////////////////////]
[section:cpp11 C++11 standard Thread library]
[///////////////////////////////////////////]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3376.html C++11 - Standard for Programming Language C++]]]
@@ -88,6 +90,7 @@
]
[endsect]
[section:cxx14 C++14 standard Thread library - accepted changes]
[//////////////////////////////////////////////////////////////]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3797.html Working Draft, Standard for Programming Language C++]]
@@ -103,6 +106,7 @@
[section:cxx1y C++14 TS Extensions for Concurrency V1 ]
[/////////////////////////////////////////////////////]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4107.html N4107-Extensions for Concurrency]]
@@ -126,8 +130,10 @@
[endsect]
[section:cxx1y C++1z TS Concurrency - On going proposals]
[///////////////////////////////////////////////////////]
[section:latch C++ Latches and Barriers]
[//////////////////////////////////////]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3600.html N3600 C++ Latches and Barriers]]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3817.html N3817 C++ Latches and Barriers]]
@@ -140,6 +146,7 @@
[endsect]
[section:queue C++ Concurrent Queues]
[///////////////////////////////////]
[note [@ http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3533.html N3533 C++ Concurrent Queues]]
@@ -183,24 +190,25 @@
[[X.3.4] [Managed Indirection] [No] [ - ]]
]
[endsect]
[section:executors Asynchronous Executors]
[section:executors Executors and Schedulers]
[//////////////////////////////////////////]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3785.pdf N3785 Executors and Schedulers]]
[table Asynchronous Executors
[table Executors and Schedulers
[[Section] [Description] [Status] [Comments]]
[[V.1.1] [Class executor] [Yes] [ - ]]
[[V.1.1] [add] [Yes] [ renamed with a function template submit ]]
[[V.1.1] [num_of_pendin_closures] [No] [ ]]
[[V.1.1] [Class `executor`] [Yes] [ - ]]
[[V.1.1] [`add`] [Yes] [ renamed with a function template `submit` ]]
[[V.1.1] [`num_of_pendin_closures`] [No] [ ]]
[[V.1.2] [Class sceduled_executor] [No] [ - ]]
[[V.1.2] [add_at] [No] [ renamed with a function template submit_at ]]
[[V.1.2] [add_after] [No] [ renamed with a function template submit_after ]]
[[V.1.2] [`add_at`] [No] [ renamed with a function template `scheduler::submit_at` ]]
[[V.1.2] [`add_after`] [No] [ renamed with a function template `scheduler::submit_after` ]]
[[V.2] [Concrete executor classes] [No] [ - ]]
[[V.2.1] [thread_pool] [Yes] [ static version Basic_thread_pool, dynamic one execduler_adaptor<basic_thread_pool> ]]
[[V.2.2] [serial_executor] [yes] [ - ]]
[[V.2.3] [loop_executor] [Yes] [ static version loop_scheduler, dynamic one execduler_adaptor<loop_scheduler> ]]
[[V.2.4] [inline_executor] [Yes] [ static version inline_executor, dynamic one execduler_adaptor<inline_executor> ]]
[[V.2.5] [thread_executor] [Yes] [ static version thread_executor, dynamic one execduler_adaptor<thread_executor> ]]
[[V.2.1] [`thread_pool`] [Yes] [ static version `basic_thread_pool`, dynamic one `execduler_adaptor<basic_thread_pool>` ]]
[[V.2.2] [`serial_executor`] [yes] [ - ]]
[[V.2.3] [`loop_executor`] [Yes] [ static version loop_scheduler, dynamic one `execduler_adaptor<loop_scheduler>` ]]
[[V.2.4] [`inline_executor`] [Yes] [ static version `inline_executor`, dynamic one `execduler_adaptor<inline_executor>` ]]
[[V.2.5] [`thread_executor`] [Yes] [ static version `thread_executor`, dynamic one `execduler_adaptor<thread_executor>` ]]
]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3784.pdf N3784-Improvements to `std::future<T> and Related APIs]]
@@ -212,8 +220,31 @@
[[30.6.8] [`async`] [Yes] [ - ]]
]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4143.pdf N4143-Executors and schedulers, revision 4]]
[table Executors and Schedulers - revision 4
[[Section] [Description] [Status] [Comments]]
[[VI.A] [Executor Concept] [Yes] [ `wrapper_type` renamed by `work` and `spawn by `submit` ]]
[[VI.A.1] [`thread_per_task_executor] [Yes] [ renamed `thread_executor`]]
[[VI.A.2] [`thread_pool_executor`] [Yes] [ renamed `basic_thread_pool`]]
[[VI.A.3] [`system_executor`] [No] [ - ]]
[[VI.A.4] [`loop_executor`] [Yes] [ - ]]
[[VI.A.5] [`serial_executor`] [yes] [ - ]]
[[VI.B] [`executor_ref`] [yes] [ - ]]
[[VI.C] [`executor`] [yes] [ renamed `gen_executor_ref` ]]
[[VI.D] [Free Functions and Helper Objects] [partial] [ - ]]
[[VI.D] [`make_package`] [No] [ - ]]
[[VI.D] [`spawn_future`] [No] [ `async(Ex&, ...)` is similar but returns a blocking future. ]]
[[VI.D] [`spawn`] [No] [ - ]]
[[VI.D] [`task_wrapper`] [No] [ renamed `resubmitter` ]]
[[VI.D] [`set_executor`] [No] [ renamed `resubmit` ]]
[[VI.D] [`function_wrapper`] [Partial] [ renamed `work` ]]
]
[endsect]
[//////////////////////////////////////////////////////////////
[section:stream_mutex C++ Stream Mutexes - C++ Stream Guards]
[/////////////////////////////////////////////////////////////]
While Boost.Thread implementation of stream mutexes differ in the approach, it is worth comparing with the current trend on the standard.
@@ -241,7 +272,7 @@ While Boost.Thread implementation of stream mutexes differ in the approach, it i
[endsect]
///////////////////////////////]
[endsect]
[endsect]

View File

@@ -28,6 +28,10 @@
#include <string>
#include <iostream>
boost::future<void> p(boost::future<void>) {
return boost::make_ready_future();
}
void p1()
{
// std::cout << BOOST_CONTEXTOF << std::endl;
@@ -147,4 +151,16 @@ int test_executor_adaptor()
int main()
{
return test_executor_adaptor();
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION \
&& defined BOOST_THREAD_PROVIDES_EXECUTORS \
&& ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
// compiles
boost::make_ready_future().then(&p);
boost::basic_thread_pool executor;
// doesn't compile
boost::make_ready_future().then(executor, &p);
#endif
}

View File

@@ -42,6 +42,14 @@ int main()
int result = f2.get();
BOOST_THREAD_LOG << "f2 " << result << BOOST_THREAD_END_LOG;
}
#if ! defined BOOST_NO_CXX14_GENERIC_LAMBDAS
{
boost::future<int> f1 = boost::async(boost::launch::async, []() {return 123;});
boost::future<int> f2 = f1.then([](auto f) {return 2*f.get(); });
int result = f2.get();
BOOST_THREAD_LOG << "f2 " << result << BOOST_THREAD_END_LOG;
}
#endif
}
catch (std::exception& ex)
{

View File

@@ -1363,6 +1363,28 @@ namespace boost
template <class F, class Rp, class Fp>
BOOST_THREAD_FUTURE<Rp>
make_future_deferred_continuation_shared_state(boost::unique_lock<boost::mutex> &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c);
template<typename F, typename Rp, typename Fp>
BOOST_THREAD_FUTURE<Rp>
make_shared_future_deferred_continuation_shared_state(boost::unique_lock<boost::mutex> &lock, F f, BOOST_THREAD_FWD_REF(Fp) c);
template<typename F, typename Rp, typename Fp>
BOOST_THREAD_FUTURE<Rp>
make_shared_future_async_continuation_shared_state(boost::unique_lock<boost::mutex> &lock, F f, BOOST_THREAD_FWD_REF(Fp) c);
#ifdef BOOST_THREAD_PROVIDES_EXECUTORS
template<typename Ex, typename F, typename Rp, typename Fp>
BOOST_THREAD_FUTURE<Rp>
make_future_executor_continuation_shared_state(Ex& ex, boost::unique_lock<boost::mutex> &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c);
template<typename Ex, typename F, typename Rp, typename Fp>
BOOST_THREAD_FUTURE<Rp>
make_shared_future_executor_continuation_shared_state(Ex& ex, boost::unique_lock<boost::mutex> &lock, F f, BOOST_THREAD_FWD_REF(Fp) c);
template <class Rp, class Fp, class Executor>
BOOST_THREAD_FUTURE<Rp>
make_future_executor_shared_state(Executor& ex, BOOST_THREAD_FWD_REF(Fp) f);
#endif
#endif
#if defined BOOST_THREAD_PROVIDES_FUTURE_UNWRAP
template<typename F, typename Rp>
@@ -1372,6 +1394,36 @@ namespace boost
make_future_unwrap_shared_state(boost::unique_lock<boost::mutex> &lock, BOOST_THREAD_RV_REF(F) f);
#endif
}
#if defined(BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY)
template< typename InputIterator>
typename boost::disable_if<is_future_type<InputIterator>,
BOOST_THREAD_FUTURE<csbl::vector<typename InputIterator::value_type> >
>::type
when_all(InputIterator first, InputIterator last);
inline BOOST_THREAD_FUTURE<csbl::tuple<> > when_all();
#if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template< typename T0, typename ...T>
BOOST_THREAD_FUTURE<csbl::tuple<typename decay<T0>::type, typename decay<T>::type...> >
when_all(BOOST_THREAD_FWD_REF(T0) f, BOOST_THREAD_FWD_REF(T) ... futures);
#endif
template< typename InputIterator>
typename boost::disable_if<is_future_type<InputIterator>,
BOOST_THREAD_FUTURE<csbl::vector<typename InputIterator::value_type> >
>::type
when_any(InputIterator first, InputIterator last);
inline BOOST_THREAD_FUTURE<csbl::tuple<> > when_any();
#if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template< typename T0, typename ...T>
BOOST_THREAD_FUTURE<csbl::tuple<typename decay<T0>::type, typename decay<T>::type...> >
when_any(BOOST_THREAD_FWD_REF(T0) f, BOOST_THREAD_FWD_REF(T) ... futures);
#endif
#endif // BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
template <typename R>
class BOOST_THREAD_FUTURE : public detail::basic_future<R>
@@ -1395,6 +1447,28 @@ namespace boost
template <class F, class Rp, class Fp>
friend BOOST_THREAD_FUTURE<Rp>
detail::make_future_deferred_continuation_shared_state(boost::unique_lock<boost::mutex> &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c);
template<typename F, typename Rp, typename Fp>
friend BOOST_THREAD_FUTURE<Rp>
detail::make_shared_future_deferred_continuation_shared_state(boost::unique_lock<boost::mutex> &lock, F f, BOOST_THREAD_FWD_REF(Fp) c);
template<typename F, typename Rp, typename Fp>
friend BOOST_THREAD_FUTURE<Rp>
detail::make_shared_future_async_continuation_shared_state(boost::unique_lock<boost::mutex> &lock, F f, BOOST_THREAD_FWD_REF(Fp) c);
#ifdef BOOST_THREAD_PROVIDES_EXECUTORS
template<typename Ex, typename F, typename Rp, typename Fp>
friend BOOST_THREAD_FUTURE<Rp>
detail::make_future_executor_continuation_shared_state(Ex& ex, boost::unique_lock<boost::mutex> &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c);
template<typename Ex, typename F, typename Rp, typename Fp>
friend BOOST_THREAD_FUTURE<Rp>
detail::make_shared_future_executor_continuation_shared_state(Ex& ex, boost::unique_lock<boost::mutex> &lock, F f, BOOST_THREAD_FWD_REF(Fp) c);
template <class Rp, class Fp, class Executor>
friend BOOST_THREAD_FUTURE<Rp>
detail::make_future_executor_shared_state(Executor& ex, BOOST_THREAD_FWD_REF(Fp) f);
#endif
#endif
#if defined BOOST_THREAD_PROVIDES_FUTURE_UNWRAP
template<typename F, typename Rp>
@@ -1403,6 +1477,35 @@ namespace boost
friend BOOST_THREAD_FUTURE<Rp>
detail::make_future_unwrap_shared_state(boost::unique_lock<boost::mutex> &lock, BOOST_THREAD_RV_REF(F) f);
#endif
#if defined(BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY)
template< typename InputIterator>
friend typename boost::disable_if<is_future_type<InputIterator>,
BOOST_THREAD_FUTURE<csbl::vector<typename InputIterator::value_type> >
>::type
when_all(InputIterator first, InputIterator last);
//friend inline BOOST_THREAD_FUTURE<csbl::tuple<> > when_all();
#if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template< typename T0, typename ...T>
friend BOOST_THREAD_FUTURE<csbl::tuple<typename decay<T0>::type, typename decay<T>::type...> >
when_all(BOOST_THREAD_FWD_REF(T0) f, BOOST_THREAD_FWD_REF(T) ... futures);
#endif
template< typename InputIterator>
friend typename boost::disable_if<is_future_type<InputIterator>,
BOOST_THREAD_FUTURE<csbl::vector<typename InputIterator::value_type> >
>::type
when_any(InputIterator first, InputIterator last);
//friend inline BOOST_THREAD_FUTURE<csbl::tuple<> > when_any();
#if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template< typename T0, typename ...T>
friend BOOST_THREAD_FUTURE<csbl::tuple<typename decay<T0>::type, typename decay<T>::type...> >
when_any(BOOST_THREAD_FWD_REF(T0) f, BOOST_THREAD_FWD_REF(T) ... futures);
#endif
#endif // BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK
template <class> friend class packaged_task; // todo check if this works in windows
#else
@@ -1418,9 +1521,7 @@ namespace boost
friend BOOST_THREAD_FUTURE<Rp>
detail::make_future_deferred_shared_state(BOOST_THREAD_FWD_REF(Fp) f);
typedef typename base_type::move_dest_type move_dest_type;
public: // when_all
BOOST_THREAD_FUTURE(future_ptr a_future):
base_type(a_future)
@@ -1588,7 +1689,7 @@ namespace boost
friend class shared_future<R>;
friend class promise<R>;
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
template <typename, typename, typename>
friend struct detail::future_async_continuation_shared_state;
template <typename, typename, typename>
@@ -1601,7 +1702,30 @@ namespace boost
template <class F, class Rp, class Fp>
friend BOOST_THREAD_FUTURE<Rp>
detail::make_future_deferred_continuation_shared_state(boost::unique_lock<boost::mutex> &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c);
#endif
template<typename F, typename Rp, typename Fp>
friend BOOST_THREAD_FUTURE<Rp>
detail::make_shared_future_deferred_continuation_shared_state(boost::unique_lock<boost::mutex> &lock, F f, BOOST_THREAD_FWD_REF(Fp) c);
template<typename F, typename Rp, typename Fp>
friend BOOST_THREAD_FUTURE<Rp>
detail::make_shared_future_async_continuation_shared_state(boost::unique_lock<boost::mutex> &lock, F f, BOOST_THREAD_FWD_REF(Fp) c);
#ifdef BOOST_THREAD_PROVIDES_EXECUTORS
template<typename Ex, typename F, typename Rp, typename Fp>
friend BOOST_THREAD_FUTURE<Rp>
detail::make_future_executor_continuation_shared_state(Ex& ex, boost::unique_lock<boost::mutex> &lock, BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_FWD_REF(Fp) c);
template<typename Ex, typename F, typename Rp, typename Fp>
friend BOOST_THREAD_FUTURE<Rp>
detail::make_shared_future_executor_continuation_shared_state(Ex& ex, boost::unique_lock<boost::mutex> &lock, F f, BOOST_THREAD_FWD_REF(Fp) c);
template <class Rp, class Fp, class Executor>
friend BOOST_THREAD_FUTURE<Rp>
detail::make_future_executor_shared_state(Executor& ex, BOOST_THREAD_FWD_REF(Fp) f);
#endif
#endif
#if defined BOOST_THREAD_PROVIDES_FUTURE_UNWRAP
template<typename F, typename Rp>
friend struct detail::future_unwrap_shared_state;
@@ -1609,6 +1733,36 @@ namespace boost
friend BOOST_THREAD_FUTURE<Rp>
detail::make_future_unwrap_shared_state(boost::unique_lock<boost::mutex> &lock, BOOST_THREAD_RV_REF(F) f);
#endif
#if defined(BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY)
template< typename InputIterator>
friend typename boost::disable_if<is_future_type<InputIterator>,
BOOST_THREAD_FUTURE<csbl::vector<typename InputIterator::value_type> >
>::type
when_all(InputIterator first, InputIterator last);
friend inline BOOST_THREAD_FUTURE<csbl::tuple<> > when_all();
#if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template< typename T0, typename ...T>
friend BOOST_THREAD_FUTURE<csbl::tuple<typename decay<T0>::type, typename decay<T>::type...> >
when_all(BOOST_THREAD_FWD_REF(T0) f, BOOST_THREAD_FWD_REF(T) ... futures);
#endif
template< typename InputIterator>
friend typename boost::disable_if<is_future_type<InputIterator>,
BOOST_THREAD_FUTURE<csbl::vector<typename InputIterator::value_type> >
>::type
when_any(InputIterator first, InputIterator last);
friend inline BOOST_THREAD_FUTURE<csbl::tuple<> > when_any();
#if ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template< typename T0, typename ...T>
friend BOOST_THREAD_FUTURE<csbl::tuple<typename decay<T0>::type, typename decay<T>::type...> >
when_any(BOOST_THREAD_FWD_REF(T0) f, BOOST_THREAD_FWD_REF(T) ... futures);
#endif
#endif // BOOST_THREAD_PROVIDES_FUTURE_WHEN_ALL_WHEN_ANY
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK
template <class> friend class packaged_task; // todo check if this works in windows
#else
@@ -1630,8 +1784,8 @@ namespace boost
base_type(a_future)
{
}
public:
BOOST_THREAD_MOVABLE_ONLY(BOOST_THREAD_FUTURE)
typedef future_state::state state;
typedef R value_type; // EXTENSION

View File

@@ -35,6 +35,7 @@ namespace boost
typedef HANDLE handle;
typedef SYSTEM_INFO system_info;
typedef unsigned __int64 ticks_type;
typedef FARPROC farproc_t;
unsigned const infinite=INFINITE;
unsigned const timeout=WAIT_TIMEOUT;
handle const invalid_handle_value=INVALID_HANDLE_VALUE;
@@ -58,17 +59,20 @@ namespace boost
using ::CreateSemaphoreExW;
# endif
using ::OpenEventW;
using ::GetModuleGandleW;
# else
using ::CreateMutexA;
using ::CreateEventA;
using ::OpenEventA;
using ::CreateSemaphoreA;
using ::GetModuleHandleA;
# endif
#if BOOST_PLAT_WINDOWS_RUNTIME
using ::GetNativeSystemInfo;
using ::GetTickCount64;
#else
using ::GetSystemInfo;
using ::GetTickCount;
#endif
using ::CloseHandle;
using ::ReleaseMutex;
@@ -86,6 +90,7 @@ namespace boost
using ::SleepEx;
using ::Sleep;
using ::QueueUserAPC;
using ::GetProcAddress;
#endif
}
}
@@ -135,6 +140,7 @@ namespace boost
typedef void* handle;
typedef _SYSTEM_INFO system_info;
typedef unsigned __int64 ticks_type;
typedef int (__stdcall *farproc_t)();
unsigned const infinite=~0U;
unsigned const timeout=258U;
handle const invalid_handle_value=(handle)(-1);
@@ -160,17 +166,20 @@ namespace boost
__declspec(dllimport) void* __stdcall CreateSemaphoreExW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*,unsigned long,unsigned long);
# endif
__declspec(dllimport) void* __stdcall OpenEventW(unsigned long,int,wchar_t const*);
__declspec(dllimport) void* __stdcall GetModuleHandleW(wchar_t const*);
# else
__declspec(dllimport) void* __stdcall CreateMutexA(_SECURITY_ATTRIBUTES*,int,char const*);
__declspec(dllimport) void* __stdcall CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*);
__declspec(dllimport) void* __stdcall CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*);
__declspec(dllimport) void* __stdcall OpenEventA(unsigned long,int,char const*);
__declspec(dllimport) void* __stdcall GetModuleHandleA(char const*);
# endif
#if BOOST_PLAT_WINDOWS_RUNTIME
__declspec(dllimport) void __stdcall GetNativeSystemInfo(_SYSTEM_INFO*);
__declspec(dllimport) ticks_type __stdcall GetTickCount64();
#else
__declspec(dllimport) void __stdcall GetSystemInfo(_SYSTEM_INFO*);
__declspec(dllimport) unsigned long __stdcall GetTickCount();
#endif
__declspec(dllimport) int __stdcall CloseHandle(void*);
__declspec(dllimport) int __stdcall ReleaseMutex(void*);
@@ -183,6 +192,7 @@ namespace boost
__declspec(dllimport) void __stdcall Sleep(unsigned long);
typedef void (__stdcall *queue_user_apc_callback_function)(ulong_ptr);
__declspec(dllimport) unsigned long __stdcall QueueUserAPC(queue_user_apc_callback_function,void*,ulong_ptr);
__declspec(dllimport) farproc_t __stdcall GetProcAddress(void *, const char *);
#endif
# ifndef UNDER_CE
@@ -216,17 +226,10 @@ namespace boost
{
namespace win32
{
namespace detail { typedef int (__stdcall *farproc_t)(); typedef ticks_type (__stdcall *gettickcount64_t)(); }
namespace detail { typedef ticks_type (__stdcall *gettickcount64_t)(); }
#if !BOOST_PLAT_WINDOWS_RUNTIME
extern "C"
{
__declspec(dllimport) detail::farproc_t __stdcall GetProcAddress(void *, const char *);
#if !defined(BOOST_NO_ANSI_APIS)
__declspec(dllimport) void * __stdcall GetModuleHandleA(const char *);
#else
__declspec(dllimport) void * __stdcall GetModuleHandleW(const wchar_t *);
#endif
__declspec(dllimport) unsigned long __stdcall GetTickCount();
#ifdef _MSC_VER
long _InterlockedCompareExchange(long volatile *, long, long);
#pragma intrinsic(_InterlockedCompareExchange)
@@ -285,6 +288,7 @@ namespace boost
// Oops, we weren't called often enough, we're stuck
return 0xFFFFFFFF;
}
#else
#endif
inline detail::gettickcount64_t GetTickCount64_()
{
@@ -297,7 +301,7 @@ namespace boost
#if BOOST_PLAT_WINDOWS_RUNTIME
gettickcount64impl = &GetTickCount64;
#else
detail::farproc_t addr=GetProcAddress(
farproc_t addr=GetProcAddress(
#if !defined(BOOST_NO_ANSI_APIS)
GetModuleHandleA("KERNEL32.DLL"),
#else

View File

@@ -281,7 +281,7 @@ int main()
BOOST_TEST(res[1].is_ready());
BOOST_TEST(res[1].get() == 321);
}
#if ! defined BOOST_NO_CXX11_DECLTYPE_N3276
#if defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD
// fixme darwin-4.8.0_11 terminate called without an active exception
{ // deferred future copy-constructible
boost::future<int> f1 = boost::async(boost::launch::deferred, &p1);

View File

@@ -152,7 +152,7 @@ int main()
BOOST_TEST(boost::csbl::get<0>(res).is_ready());
BOOST_TEST(boost::csbl::get<0>(res).get() == 123);
}
#if ! defined BOOST_NO_CXX11_DECLTYPE_N3276
#if defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD
// fixme darwin-4.8.0_11 terminate called without an active exception
{ // deferred future copy-constructible
boost::future<int> f1 = boost::async(boost::launch::deferred, &p1);

View File

@@ -236,7 +236,7 @@ int main()
BOOST_TEST(boost::csbl::get<1>(res).is_ready());
BOOST_TEST(boost::csbl::get<1>(res).get() == 321);
}
#if ! defined BOOST_NO_CXX11_DECLTYPE_N3276
#if defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD
// fixme darwin-4.8.0_11 terminate called without an active exception
{ // deferred future copy-constructible
boost::future<int> f1 = boost::async(boost::launch::deferred, &p1);

View File

@@ -283,7 +283,7 @@ int main()
BOOST_TEST(res[1].is_ready());
BOOST_TEST(res[1].get() == 321);
}
#if ! defined BOOST_NO_CXX11_DECLTYPE_N3276
#if defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD
// fixme darwin-4.8.0_11 terminate called without an active exception
{ // deferred future copy-constructible
boost::future<int> f1 = boost::async(boost::launch::deferred, &p1);

View File

@@ -125,7 +125,7 @@ int main()
BOOST_TEST(boost::csbl::get<0>(res).is_ready());
BOOST_TEST(boost::csbl::get<0>(res).get() == 123);
}
#if ! defined BOOST_NO_CXX11_DECLTYPE_N3276
#if defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD
// fixme darwin-4.8.0_11 terminate called without an active exception
{ // deferred future copy-constructible
boost::future<int> f1 = boost::async(boost::launch::deferred, &p1);

View File

@@ -225,7 +225,7 @@ int main()
BOOST_TEST(boost::csbl::get<0>(res).get() == 123);
BOOST_TEST(boost::csbl::get<1>(res).get() == 321);
}
#if ! defined BOOST_NO_CXX11_DECLTYPE_N3276
#if defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD
// fixme darwin-4.8.0_11 terminate called without an active exception
{ // deferred future copy-constructible
boost::future<int> f1 = boost::async(boost::launch::deferred, &p1);

View File

@@ -21,9 +21,9 @@
class non_copyable
{
BOOST_THREAD_MOVABLE_ONLY(non_copyable)
int val;
public:
BOOST_THREAD_MOVABLE_ONLY(non_copyable)
non_copyable(int v) : val(v){}
non_copyable(BOOST_RV_REF(non_copyable) x): val(x.val) {}
non_copyable& operator=(BOOST_RV_REF(non_copyable) x) { val=x.val; return *this; }

View File

@@ -21,9 +21,9 @@
class non_copyable
{
BOOST_THREAD_MOVABLE_ONLY(non_copyable)
int val;
public:
BOOST_THREAD_MOVABLE_ONLY(non_copyable)
non_copyable(int v) : val(v){}
non_copyable(BOOST_RV_REF(non_copyable) x): val(x.val) {}
non_copyable& operator=(BOOST_RV_REF(non_copyable) x) { val=x.val; return *this; }