mirror of
https://github.com/boostorg/thread.git
synced 2026-07-21 13:33:33 +00:00
Compare commits
72 Commits
boost-1.84.0
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| 608459ab7c | |||
| 3f285e5600 | |||
| c28c5a4b28 | |||
| 0bdc465f89 | |||
| aeabeffe4d | |||
| 6fdc4aa10d | |||
| 65410ba739 | |||
| 171eb5811e | |||
| 03db328308 | |||
| fbeebd66eb | |||
| 5a5554a3a6 | |||
| 031406d2f3 | |||
| 1ce6bceadf | |||
| 55cbdeefe4 | |||
| 04da999e57 | |||
| 884ce13ddd | |||
| 2f9ffdbb63 | |||
| 53d49020f6 | |||
| 79ebce2326 | |||
| 78190abb18 | |||
| 3b4615d9e7 | |||
| 7bcb46a9c7 | |||
| c8c283c1e7 | |||
| d5c457aa4a | |||
| dd60839a4e | |||
| fc290ec4be | |||
| b140c29da3 | |||
| 559143bde2 | |||
| ef5505e0a1 | |||
| 07a7ded841 | |||
| 375ba39cf9 | |||
| 48929e4281 | |||
| 07b93da337 | |||
| 072ee46e8a | |||
| ac15f907be | |||
| e2f6e8789f | |||
| 24917577d7 | |||
| 6da5c6d418 | |||
| de9eb0ee7d | |||
| f19c0d3b56 | |||
| 3d95d2366e | |||
| ed7171099b | |||
| 36f63a1b63 | |||
| 2a953f1c4b | |||
| c34d1fd2d9 | |||
| be42bd8d10 | |||
| 45e77a932f | |||
| b712fac6cc | |||
| ca6b6affec | |||
| a1f89c9518 | |||
| 28d58852bb | |||
| 4e0a88853a | |||
| 5d68c9c42c | |||
| b3183638cb | |||
| 48482ff696 | |||
| 76411e5918 | |||
| 49ccf9c30a | |||
| 814ed9f341 | |||
| 82aa252a9e | |||
| b1ff784e51 | |||
| e6e4e53807 | |||
| 0fc00ec05c | |||
| 435a623e48 | |||
| 0a8c93842e | |||
| ca4b54f96c | |||
| 43bfe9cbd2 | |||
| 691b64d5aa | |||
| e2de571359 | |||
| 8811487643 | |||
| 7e2cd262ce | |||
| 637ceec996 | |||
| ee609e8806 |
+1193
-73
File diff suppressed because it is too large
Load Diff
@@ -69,7 +69,6 @@ target_link_libraries(boost_thread
|
||||
Boost::predef
|
||||
Boost::preprocessor
|
||||
Boost::smart_ptr
|
||||
Boost::static_assert
|
||||
Boost::system
|
||||
Boost::throw_exception
|
||||
Boost::tuple
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
# Copyright René Ferdinand Rivera Morell 2023-2024
|
||||
# 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)
|
||||
|
||||
require-b2 5.2 ;
|
||||
|
||||
constant boost_dependencies :
|
||||
/boost/assert//boost_assert
|
||||
/boost/atomic//boost_atomic
|
||||
/boost/bind//boost_bind
|
||||
/boost/chrono//boost_chrono
|
||||
/boost/concept_check//boost_concept_check
|
||||
/boost/config//boost_config
|
||||
/boost/container//boost_container
|
||||
/boost/container_hash//boost_container_hash
|
||||
/boost/core//boost_core
|
||||
/boost/date_time//boost_date_time
|
||||
/boost/exception//boost_exception
|
||||
/boost/function//boost_function
|
||||
/boost/io//boost_io
|
||||
/boost/move//boost_move
|
||||
/boost/optional//boost_optional
|
||||
/boost/predef//boost_predef
|
||||
/boost/preprocessor//boost_preprocessor
|
||||
/boost/smart_ptr//boost_smart_ptr
|
||||
/boost/system//boost_system
|
||||
/boost/throw_exception//boost_throw_exception
|
||||
/boost/tuple//boost_tuple
|
||||
/boost/type_traits//boost_type_traits
|
||||
/boost/utility//boost_utility
|
||||
/boost/winapi//boost_winapi ;
|
||||
|
||||
project /boost/thread
|
||||
;
|
||||
|
||||
explicit
|
||||
[ alias boost_thread : build//boost_thread ]
|
||||
[ alias all : boost_thread example test ]
|
||||
;
|
||||
|
||||
call-if : boost-library thread
|
||||
: install boost_thread
|
||||
;
|
||||
|
||||
+20
-10
@@ -35,18 +35,22 @@
|
||||
import os ;
|
||||
import indirect ;
|
||||
import path ;
|
||||
import configure ;
|
||||
import configure ;
|
||||
import threadapi-feature ;
|
||||
|
||||
exe has_atomic_flag_lockfree : ../build/has_atomic_flag_lockfree_test.cpp ;
|
||||
|
||||
project boost/thread
|
||||
project
|
||||
: source-location ../src
|
||||
: common-requirements
|
||||
<library>$(boost_dependencies)
|
||||
<include>../include
|
||||
: requirements <threading>multi
|
||||
#<link>static:<define>BOOST_THREAD_STATIC_LINK=1
|
||||
#<link>shared:<define>BOOST_THREAD_DYN_LINK=1
|
||||
<link>static:<define>BOOST_THREAD_BUILD_LIB=1
|
||||
<link>shared:<define>BOOST_THREAD_BUILD_DLL=1
|
||||
-<tag>@%boostcpp.tag
|
||||
-<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
|
||||
<tag>@$(__name__).tag
|
||||
<toolset>gcc:<cxxflags>-Wno-long-long
|
||||
@@ -139,6 +143,7 @@ project boost/thread
|
||||
#<define>BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED
|
||||
#<define>BOOST_SYSTEM_NO_DEPRECATED
|
||||
#<define>BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
|
||||
<define>BOOST_THREAD_NO_LIB=1
|
||||
;
|
||||
|
||||
rule tag ( name : type ? : property-set )
|
||||
@@ -156,8 +161,15 @@ rule tag ( name : type ? : property-set )
|
||||
}
|
||||
|
||||
# forward to the boost tagging rule
|
||||
return [ indirect.call $(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
|
||||
$(result) : $(type) : $(property-set) ] ;
|
||||
if $(BOOST_JAMROOT_MODULE)
|
||||
{
|
||||
return [ indirect.call $(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
|
||||
$(result) : $(type) : $(property-set) ] ;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $(result) ;
|
||||
}
|
||||
}
|
||||
|
||||
rule win32_pthread_paths ( properties * )
|
||||
@@ -269,10 +281,10 @@ rule requirements ( properties * )
|
||||
}
|
||||
}
|
||||
result += <define>BOOST_THREAD_DONT_USE_CHRONO ;
|
||||
if ! [ configure.builds has_atomic_flag_lockfree
|
||||
: $(properties) : "lockfree boost::atomic_flag" ] {
|
||||
result += <library>/boost/atomic//boost_atomic ;
|
||||
}
|
||||
if ! [ configure.builds has_atomic_flag_lockfree
|
||||
: $(properties) : "lockfree boost::atomic_flag" ] {
|
||||
result += <library>/boost/atomic//boost_atomic ;
|
||||
}
|
||||
} else {
|
||||
if <threadapi>win32 in $(properties)
|
||||
{
|
||||
@@ -315,5 +327,3 @@ lib boost_thread
|
||||
<link>static:<define>BOOST_THREAD_USE_LIB=1
|
||||
<conditional>@usage-requirements
|
||||
;
|
||||
|
||||
boost-install boost_thread ;
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
[/
|
||||
(C) Copyright 20012 Vicente J. Botet Escriba.
|
||||
(C) Copyright 2012 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).
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[/
|
||||
(C) Copyright 2007-12 Anthony Williams.
|
||||
(C) Copyright 20012 Vicente J. Botet Escriba.
|
||||
(C) Copyright 2012 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).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[/
|
||||
(C) Copyright 2008-9 Anthony Williams.
|
||||
(C) Copyright 12 Vicente J. Botet Escriba.
|
||||
(C) Copyright 2012 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).
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
# 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)
|
||||
|
||||
project boost/thread/example
|
||||
project
|
||||
: requirements <library>../build//boost_thread <threading>multi
|
||||
;
|
||||
|
||||
|
||||
@@ -112,21 +112,21 @@ int main()
|
||||
#if __cplusplus > 201103L
|
||||
{
|
||||
std::cout << __FILE__ << " "<< __LINE__ << std::endl;
|
||||
int i = 0;
|
||||
boost::future<int&> f = boost::make_ready_future(std::ref(i));
|
||||
int x = 0;
|
||||
boost::future<int&> f = boost::make_ready_future(std::ref(x));
|
||||
std::cout << f.get() << std::endl;
|
||||
}
|
||||
#endif
|
||||
{
|
||||
std::cout << __FILE__ << " "<< __LINE__ << std::endl;
|
||||
int i = 0;
|
||||
boost::future<int&> f = boost::make_ready_future(boost::ref(i));
|
||||
int x = 0;
|
||||
boost::future<int&> f = boost::make_ready_future(boost::ref(x));
|
||||
std::cout << f.get() << std::endl;
|
||||
}
|
||||
{
|
||||
std::cout << __FILE__ << " "<< __LINE__ << std::endl;
|
||||
const int i = 0;
|
||||
boost::future<int const&> f = boost::make_ready_future(boost::cref(i));
|
||||
const int x = 0;
|
||||
boost::future<int const&> f = boost::make_ready_future(boost::cref(x));
|
||||
std::cout << f.get() << std::endl;
|
||||
}
|
||||
{
|
||||
@@ -142,12 +142,12 @@ int main()
|
||||
}
|
||||
catch (std::exception& ex)
|
||||
{
|
||||
std::cout << "ERRORRRRR "<<ex.what() << "" << std::endl;
|
||||
std::cout << "ERRORRRRR " << ex.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cout << "ERRORRRRR "<<"ERRORRRRR exception thrown" << std::endl;
|
||||
std::cout << "ERRORRRRR ERRORRRRR exception thrown" << std::endl;
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
|
||||
+4
-4
@@ -8,7 +8,7 @@
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <iostream>
|
||||
|
||||
boost::mutex io_mutex; // The iostreams are not guaranteed to be thread-safe!
|
||||
boost::mutex g_io_mutex; // The iostreams are not guaranteed to be thread-safe!
|
||||
|
||||
class counter
|
||||
{
|
||||
@@ -25,12 +25,12 @@ private:
|
||||
int count;
|
||||
};
|
||||
|
||||
counter c;
|
||||
counter g_counter;
|
||||
|
||||
void change_count()
|
||||
{
|
||||
int i = c.increment();
|
||||
boost::unique_lock<boost::mutex> scoped_lock(io_mutex);
|
||||
int i = g_counter.increment();
|
||||
boost::unique_lock<boost::mutex> scoped_lock(g_io_mutex);
|
||||
std::cout << "count == " << i << std::endl;
|
||||
}
|
||||
|
||||
|
||||
+8
-8
@@ -10,23 +10,23 @@
|
||||
#include <boost/thread/once.hpp>
|
||||
#include <cassert>
|
||||
|
||||
int value=0;
|
||||
int g_value=0;
|
||||
#ifdef BOOST_THREAD_PROVIDES_ONCE_CXX11
|
||||
static boost::once_flag once;
|
||||
//static boost::once_flag once2 = BOOST_ONCE_INIT;
|
||||
static boost::once_flag g_once;
|
||||
//static boost::once_flag g_once2 = BOOST_ONCE_INIT;
|
||||
#else
|
||||
static boost::once_flag once = BOOST_ONCE_INIT;
|
||||
//static boost::once_flag once2 = once;
|
||||
static boost::once_flag g_once = BOOST_ONCE_INIT;
|
||||
//static boost::once_flag g_once2 = g_once;
|
||||
#endif
|
||||
|
||||
void init()
|
||||
{
|
||||
++value;
|
||||
++g_value;
|
||||
}
|
||||
|
||||
void thread_proc()
|
||||
{
|
||||
boost::call_once(&init, once);
|
||||
boost::call_once(&init, g_once);
|
||||
}
|
||||
|
||||
int main()
|
||||
@@ -35,5 +35,5 @@ int main()
|
||||
for (int i=0; i<5; ++i)
|
||||
threads.create_thread(&thread_proc);
|
||||
threads.join_all();
|
||||
assert(value == 1);
|
||||
assert(g_value == 1);
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ void consumer(
|
||||
try {
|
||||
for(int i=0; ;++i)
|
||||
{
|
||||
(void)i;
|
||||
int r;
|
||||
sbq.pull(r);
|
||||
//sbq >> r;
|
||||
@@ -77,6 +78,7 @@ void consumer2(the_ostream &/*mos*/, boost::sync_queue<int> & sbq)
|
||||
try {
|
||||
for(int i=0; ;++i)
|
||||
{
|
||||
(void)i;
|
||||
int r;
|
||||
queue_op_status st = sbq.try_pull(r);
|
||||
if (queue_op_status::closed == st) break;
|
||||
@@ -97,6 +99,7 @@ void consumer3(the_ostream &/*mos*/, boost::sync_queue<int> & sbq)
|
||||
try {
|
||||
for(int i=0; ;++i)
|
||||
{
|
||||
(void)i;
|
||||
int r;
|
||||
queue_op_status res = sbq.wait_pull(r);
|
||||
if (res==queue_op_status::closed) break;
|
||||
|
||||
@@ -57,6 +57,7 @@ void consumer(
|
||||
try {
|
||||
for(int i=0; ;++i)
|
||||
{
|
||||
(void)i;
|
||||
int r;
|
||||
sbq.pull(r);
|
||||
//sbq >> r;
|
||||
@@ -80,6 +81,7 @@ void consumer2(the_ostream &/*mos*/, boost::queue_front<int> sbq)
|
||||
try {
|
||||
for(int i=0; ;++i)
|
||||
{
|
||||
(void)i;
|
||||
int r;
|
||||
queue_op_status st = sbq.try_pull(r);
|
||||
if (queue_op_status::closed == st) break;
|
||||
@@ -100,6 +102,7 @@ void consumer3(the_ostream &/*mos*/, boost::queue_front<int> sbq)
|
||||
try {
|
||||
for(int i=0; ;++i)
|
||||
{
|
||||
(void)i;
|
||||
int r;
|
||||
queue_op_status res = sbq.wait_pull(r);
|
||||
if (res==queue_op_status::closed) break;
|
||||
|
||||
@@ -55,6 +55,7 @@ void consumer(the_ostream &/*mos*/, boost::sync_bounded_queue<int> & sbq)
|
||||
try {
|
||||
for(int i=0; ;++i)
|
||||
{
|
||||
(void)i;
|
||||
int r;
|
||||
sbq.pull_front(r);
|
||||
//sbq >> r;
|
||||
@@ -77,6 +78,7 @@ void consumer2(the_ostream &/*mos*/, boost::sync_bounded_queue<int> & sbq)
|
||||
try {
|
||||
for(int i=0; ;++i)
|
||||
{
|
||||
(void)i;
|
||||
int r;
|
||||
queue_op_status st = sbq.try_pull_front(r);
|
||||
if (queue_op_status::closed == st) break;
|
||||
|
||||
@@ -28,11 +28,11 @@ private:
|
||||
int count;
|
||||
};
|
||||
|
||||
counter c;
|
||||
counter g_counter;
|
||||
|
||||
void change_count()
|
||||
{
|
||||
//std::cout << "count == " << c.increment() << std::endl;
|
||||
//std::cout << "count == " << g_counter.increment() << std::endl;
|
||||
}
|
||||
|
||||
int main(int, char*[])
|
||||
|
||||
@@ -26,6 +26,7 @@ struct func
|
||||
int& i;
|
||||
|
||||
func(int& i_):i(i_){}
|
||||
func(func const& that):i(that.i){}
|
||||
|
||||
void operator()()
|
||||
{
|
||||
|
||||
+20
-20
@@ -28,9 +28,9 @@ enum game_state
|
||||
BOTH_PLAYERS_GONE
|
||||
};
|
||||
|
||||
int state;
|
||||
boost::mutex mutex;
|
||||
boost::condition cond;
|
||||
int g_state;
|
||||
boost::mutex g_mutex;
|
||||
boost::condition g_cond;
|
||||
|
||||
const char* player_name(int state)
|
||||
{
|
||||
@@ -44,29 +44,29 @@ const char* player_name(int state)
|
||||
|
||||
void player(int active)
|
||||
{
|
||||
boost::unique_lock<boost::mutex> lock(mutex);
|
||||
boost::unique_lock<boost::mutex> lock(g_mutex);
|
||||
|
||||
int other = active == PLAYER_A ? PLAYER_B : PLAYER_A;
|
||||
|
||||
while (state < GAME_OVER)
|
||||
while (g_state < GAME_OVER)
|
||||
{
|
||||
//std::cout << player_name(active) << ": Play." << std::endl;
|
||||
state = other;
|
||||
cond.notify_all();
|
||||
g_state = other;
|
||||
g_cond.notify_all();
|
||||
do
|
||||
{
|
||||
cond.wait(lock);
|
||||
if (state == other)
|
||||
g_cond.wait(lock);
|
||||
if (g_state == other)
|
||||
{
|
||||
std::cout << "---" << player_name(active)
|
||||
<< ": Spurious wakeup!" << std::endl;
|
||||
}
|
||||
} while (state == other);
|
||||
} while (g_state == other);
|
||||
}
|
||||
|
||||
++state;
|
||||
++g_state;
|
||||
std::cout << player_name(active) << ": Gone." << std::endl;
|
||||
cond.notify_all();
|
||||
g_cond.notify_all();
|
||||
}
|
||||
|
||||
struct thread_adapt
|
||||
@@ -100,7 +100,7 @@ private:
|
||||
|
||||
int main()
|
||||
{
|
||||
state = START;
|
||||
g_state = START;
|
||||
|
||||
boost::thread thrda(&player, PLAYER_A);
|
||||
boost::thread thrdb(&player, PLAYER_B);
|
||||
@@ -110,22 +110,22 @@ int main()
|
||||
xt.sec += 1;
|
||||
boost::thread::sleep(xt);
|
||||
{
|
||||
boost::unique_lock<boost::mutex> lock(mutex);
|
||||
boost::unique_lock<boost::mutex> lock(g_mutex);
|
||||
std::cout << "---Noise ON..." << std::endl;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 10; ++i)
|
||||
cond.notify_all();
|
||||
g_cond.notify_all();
|
||||
|
||||
{
|
||||
boost::unique_lock<boost::mutex> lock(mutex);
|
||||
boost::unique_lock<boost::mutex> lock(g_mutex);
|
||||
std::cout << "---Noise OFF..." << std::endl;
|
||||
state = GAME_OVER;
|
||||
cond.notify_all();
|
||||
g_state = GAME_OVER;
|
||||
g_cond.notify_all();
|
||||
do
|
||||
{
|
||||
cond.wait(lock);
|
||||
} while (state != BOTH_PLAYERS_GONE);
|
||||
g_cond.wait(lock);
|
||||
} while (g_state != BOTH_PLAYERS_GONE);
|
||||
}
|
||||
|
||||
std::cout << "GAME OVER" << std::endl;
|
||||
|
||||
+11
-12
@@ -8,23 +8,22 @@
|
||||
#include <iostream>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
int count = 0;
|
||||
boost::mutex mutex;
|
||||
int g_count = 0;
|
||||
boost::mutex g_mutex;
|
||||
|
||||
void increment_count()
|
||||
{
|
||||
boost::unique_lock<boost::mutex> lock(mutex);
|
||||
std::cout << "count = " << ++count << std::endl;
|
||||
boost::unique_lock<boost::mutex> lock(g_mutex);
|
||||
std::cout << "count = " << ++g_count << std::endl;
|
||||
}
|
||||
|
||||
boost::thread_group threads2;
|
||||
boost::thread* th2 = 0;
|
||||
boost::thread_group g_threads2;
|
||||
|
||||
void increment_count_2()
|
||||
{
|
||||
boost::unique_lock<boost::mutex> lock(mutex);
|
||||
BOOST_TEST(threads2.is_this_thread_in());
|
||||
std::cout << "count = " << ++count << std::endl;
|
||||
boost::unique_lock<boost::mutex> lock(g_mutex);
|
||||
BOOST_TEST(g_threads2.is_this_thread_in());
|
||||
std::cout << "count = " << ++g_count << std::endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
@@ -63,11 +62,11 @@ int main()
|
||||
}
|
||||
{
|
||||
{
|
||||
boost::unique_lock<boost::mutex> lock(mutex);
|
||||
boost::unique_lock<boost::mutex> lock(g_mutex);
|
||||
boost::thread* th2 = new boost::thread(&increment_count_2);
|
||||
threads2.add_thread(th2);
|
||||
g_threads2.add_thread(th2);
|
||||
}
|
||||
threads2.join_all();
|
||||
g_threads2.join_all();
|
||||
}
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
+4
-4
@@ -8,21 +8,21 @@
|
||||
#include <boost/thread/tss.hpp>
|
||||
#include <cassert>
|
||||
|
||||
boost::thread_specific_ptr<int> value;
|
||||
boost::thread_specific_ptr<int> g_value;
|
||||
|
||||
void increment()
|
||||
{
|
||||
int* p = value.get();
|
||||
int* p = g_value.get();
|
||||
++*p;
|
||||
}
|
||||
|
||||
void thread_proc()
|
||||
{
|
||||
value.reset(new int(0)); // initialize the thread's storage
|
||||
g_value.reset(new int(0)); // initialize the thread's storage
|
||||
for (int i=0; i<10; ++i)
|
||||
{
|
||||
increment();
|
||||
int* p = value.get();
|
||||
int* p = g_value.get();
|
||||
assert(*p == i+1);
|
||||
(void)(p);
|
||||
}
|
||||
|
||||
@@ -12,18 +12,18 @@
|
||||
#include <boost/thread/scoped_thread.hpp>
|
||||
#include <boost/thread/with_lock_guard.hpp>
|
||||
|
||||
boost::mutex m; // protection for 'x' and 'std::cout'
|
||||
int x;
|
||||
boost::mutex g_mutex; // protection for 'g_x' and 'std::cout'
|
||||
int g_x = 0;
|
||||
|
||||
#if defined(BOOST_NO_CXX11_LAMBDAS) || (defined BOOST_MSVC && _MSC_VER < 1700)
|
||||
void print_x() {
|
||||
++x;
|
||||
std::cout << "x = " << x << std::endl;
|
||||
++g_x;
|
||||
std::cout << "x = " << g_x << std::endl;
|
||||
}
|
||||
|
||||
void job() {
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
boost::with_lock_guard(m, print_x);
|
||||
boost::with_lock_guard(g_mutex, print_x);
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(100));
|
||||
}
|
||||
}
|
||||
@@ -31,10 +31,10 @@ void job() {
|
||||
void job() {
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
boost::with_lock_guard(
|
||||
m,
|
||||
g_mutex,
|
||||
[]() {
|
||||
++x;
|
||||
std::cout << "x = " << x << std::endl;
|
||||
++g_x;
|
||||
std::cout << "x = " << g_x << std::endl;
|
||||
}
|
||||
);
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(100));
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/core/ref.hpp>
|
||||
|
||||
#include <boost/thread/detail/config.hpp>
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
@@ -187,7 +188,7 @@ namespace detail
|
||||
template <class ValueType, class Queue>
|
||||
bool sync_deque_base<ValueType, Queue>::wait_until_not_empty_or_closed(unique_lock<mutex>& lk)
|
||||
{
|
||||
cond_.wait(lk, boost::bind(&sync_deque_base<ValueType, Queue>::not_empty_or_closed, boost::ref(*this), boost::ref(lk)));
|
||||
cond_.wait(lk, boost::bind(&sync_deque_base<ValueType, Queue>::not_empty_or_closed, this, boost::ref(lk)));
|
||||
if (! empty(lk)) return false; // success
|
||||
return true; // closed
|
||||
}
|
||||
@@ -196,7 +197,7 @@ namespace detail
|
||||
template <class WClock, class Duration>
|
||||
queue_op_status sync_deque_base<ValueType, Queue>::wait_until_not_empty_or_closed_until(unique_lock<mutex>& lk, chrono::time_point<WClock,Duration> const&tp)
|
||||
{
|
||||
if (! cond_.wait_until(lk, tp, boost::bind(&sync_deque_base<ValueType, Queue>::not_empty_or_closed, boost::ref(*this), boost::ref(lk))))
|
||||
if (! cond_.wait_until(lk, tp, boost::bind(&sync_deque_base<ValueType, Queue>::not_empty_or_closed, this, boost::ref(lk))))
|
||||
return queue_op_status::timeout;
|
||||
if (! empty(lk)) return queue_op_status::success;
|
||||
return queue_op_status::closed;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/core/ref.hpp>
|
||||
|
||||
#include <boost/thread/detail/config.hpp>
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
@@ -187,7 +188,7 @@ namespace detail
|
||||
template <class ValueType, class Queue>
|
||||
bool sync_queue_base<ValueType, Queue>::wait_until_not_empty_or_closed(unique_lock<mutex>& lk)
|
||||
{
|
||||
cond_.wait(lk, boost::bind(&sync_queue_base<ValueType, Queue>::not_empty_or_closed, boost::ref(*this), boost::ref(lk)));
|
||||
cond_.wait(lk, boost::bind(&sync_queue_base<ValueType, Queue>::not_empty_or_closed, this, boost::ref(lk)));
|
||||
if (! empty(lk)) return false; // success
|
||||
return true; // closed
|
||||
}
|
||||
@@ -196,7 +197,7 @@ namespace detail
|
||||
template <class WClock, class Duration>
|
||||
queue_op_status sync_queue_base<ValueType, Queue>::wait_until_not_empty_or_closed_until(unique_lock<mutex>& lk, chrono::time_point<WClock,Duration> const&tp)
|
||||
{
|
||||
if (! cond_.wait_until(lk, tp, boost::bind(&sync_queue_base<ValueType, Queue>::not_empty_or_closed, boost::ref(*this), boost::ref(lk))))
|
||||
if (! cond_.wait_until(lk, tp, boost::bind(&sync_queue_base<ValueType, Queue>::not_empty_or_closed, this, boost::ref(lk))))
|
||||
return queue_op_status::timeout;
|
||||
if (! empty(lk)) return queue_op_status::success;
|
||||
return queue_op_status::closed;
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <algorithm>
|
||||
#include <boost/core/ref.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <stdlib.h>
|
||||
#include <memory>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
@@ -47,6 +46,8 @@
|
||||
|
||||
#if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
#include <tuple>
|
||||
#else
|
||||
#include <boost/bind/bind.hpp>
|
||||
#endif
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ BOOST_THREAD_INLINE_NAMESPACE(v2)
|
||||
|
||||
namespace detail
|
||||
{
|
||||
void handle_task_region_exceptions(exception_list& errors)
|
||||
inline void handle_task_region_exceptions(exception_list& errors)
|
||||
{
|
||||
try {
|
||||
throw;
|
||||
|
||||
@@ -392,7 +392,7 @@ namespace boost
|
||||
is_deferred_=false;
|
||||
execute(lk);
|
||||
}
|
||||
waiters.wait(lk, boost::bind(&shared_state_base::is_done, boost::ref(*this)));
|
||||
waiters.wait(lk, boost::bind(&shared_state_base::is_done, this));
|
||||
if(rethrow && exception)
|
||||
{
|
||||
boost::rethrow_exception(exception);
|
||||
@@ -419,7 +419,7 @@ namespace boost
|
||||
return false;
|
||||
|
||||
do_callback(lock);
|
||||
return waiters.timed_wait(lock, rel_time, boost::bind(&shared_state_base::is_done, boost::ref(*this)));
|
||||
return waiters.timed_wait(lock, rel_time, boost::bind(&shared_state_base::is_done, this));
|
||||
}
|
||||
|
||||
bool timed_wait_until(boost::system_time const& target_time)
|
||||
@@ -429,7 +429,7 @@ namespace boost
|
||||
return false;
|
||||
|
||||
do_callback(lock);
|
||||
return waiters.timed_wait(lock, target_time, boost::bind(&shared_state_base::is_done, boost::ref(*this)));
|
||||
return waiters.timed_wait(lock, target_time, boost::bind(&shared_state_base::is_done, this));
|
||||
}
|
||||
#endif
|
||||
#ifdef BOOST_THREAD_USES_CHRONO
|
||||
@@ -442,7 +442,7 @@ namespace boost
|
||||
if (is_deferred_)
|
||||
return future_status::deferred;
|
||||
do_callback(lock);
|
||||
if(!waiters.wait_until(lock, abs_time, boost::bind(&shared_state_base::is_done, boost::ref(*this))))
|
||||
if(!waiters.wait_until(lock, abs_time, boost::bind(&shared_state_base::is_done, this)))
|
||||
{
|
||||
return future_status::timeout;
|
||||
}
|
||||
@@ -939,7 +939,7 @@ namespace boost
|
||||
join();
|
||||
#elif defined BOOST_THREAD_ASYNC_FUTURE_WAITS
|
||||
unique_lock<boost::mutex> lk(this->mutex);
|
||||
this->waiters.wait(lk, boost::bind(&shared_state_base::is_done, boost::ref(*this)));
|
||||
this->waiters.wait(lk, boost::bind(&shared_state_base::is_done, this));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -4649,32 +4649,34 @@ namespace detail
|
||||
shared_ptr<FutureExecutorContinuationSharedState> that_;
|
||||
|
||||
#if ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(run_it)
|
||||
run_it(run_it const& x) //BOOST_NOEXCEPT
|
||||
: that_(x.that_)
|
||||
{}
|
||||
run_it& operator=(BOOST_THREAD_COPY_ASSIGN_REF(run_it) x) //BOOST_NOEXCEPT
|
||||
{
|
||||
if (this != &x) {
|
||||
that_=x.that_;
|
||||
}
|
||||
return *this;
|
||||
BOOST_THREAD_COPYABLE_AND_MOVABLE(run_it)
|
||||
run_it(run_it const& x) //BOOST_NOEXCEPT
|
||||
: that_(x.that_)
|
||||
{}
|
||||
run_it& operator=(BOOST_THREAD_COPY_ASSIGN_REF(run_it) x) //BOOST_NOEXCEPT
|
||||
{
|
||||
if (this != &x) {
|
||||
that_=x.that_;
|
||||
}
|
||||
// move
|
||||
run_it(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT
|
||||
: that_(x.that_)
|
||||
{
|
||||
x.that_.reset();
|
||||
}
|
||||
run_it& operator=(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT {
|
||||
if (this != &x) {
|
||||
that_=x.that;
|
||||
x.that_.reset();
|
||||
}
|
||||
return *this;
|
||||
return *this;
|
||||
}
|
||||
// move
|
||||
run_it(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT
|
||||
: that_(boost::move(x.that_))
|
||||
{
|
||||
}
|
||||
run_it& operator=(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT {
|
||||
if (this != &x) {
|
||||
that_ = boost::move(x.that_);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
run_it(shared_ptr<FutureExecutorContinuationSharedState> that) : that_(boost::move(that))
|
||||
{}
|
||||
#else
|
||||
run_it(shared_ptr<FutureExecutorContinuationSharedState> that) : that_(that)
|
||||
{}
|
||||
#endif
|
||||
run_it(shared_ptr<FutureExecutorContinuationSharedState> that) : that_ (that) {}
|
||||
|
||||
void operator()()
|
||||
{
|
||||
|
||||
@@ -19,14 +19,17 @@
|
||||
#include <boost/thread/detail/delete.hpp>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <pthread.h>
|
||||
#include <csignal>
|
||||
|
||||
#if !defined(BOOST_THREAD_PROVIDES_INVOKE) && !defined(BOOST_THREAD_PROVIDES_INVOKE_RET)
|
||||
#include <boost/bind/bind.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
|
||||
@@ -16,8 +16,12 @@
|
||||
#include <boost/thread/detail/move.hpp>
|
||||
#include <boost/thread/detail/invoke.hpp>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
#include <boost/atomic/capabilities.hpp>
|
||||
#include <boost/atomic/atomic.hpp>
|
||||
|
||||
#if !defined(BOOST_THREAD_PROVIDES_INVOKE) && !defined(BOOST_THREAD_PROVIDES_INVOKE_RET)
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/atomic.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <boost/thread/detail/config.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace boost
|
||||
boost::this_thread::disable_interruption do_not_disturb;
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
shared_cond.wait(lk, boost::bind(&state_data::can_lock_shared, boost::ref(state)));
|
||||
shared_cond.wait(lk, boost::bind(&state_data::can_lock_shared, &state));
|
||||
state.lock_shared();
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace boost
|
||||
boost::this_thread::disable_interruption do_not_disturb;
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
if(!shared_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock_shared, boost::ref(state))))
|
||||
if(!shared_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock_shared, &state)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -209,7 +209,7 @@ namespace boost
|
||||
boost::this_thread::disable_interruption do_not_disturb;
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
if(!shared_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock_shared, boost::ref(state))))
|
||||
if(!shared_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock_shared, &state)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -230,7 +230,7 @@ namespace boost
|
||||
boost::this_thread::disable_interruption do_not_disturb;
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_shared, boost::ref(state))))
|
||||
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_shared, &state)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -270,7 +270,7 @@ namespace boost
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
state.exclusive_waiting_blocked=true;
|
||||
exclusive_cond.wait(lk, boost::bind(&state_data::can_lock, boost::ref(state)));
|
||||
exclusive_cond.wait(lk, boost::bind(&state_data::can_lock, &state));
|
||||
state.exclusive=true;
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ namespace boost
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
state.exclusive_waiting_blocked=true;
|
||||
if(!exclusive_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock, boost::ref(state))))
|
||||
if(!exclusive_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock, &state)))
|
||||
{
|
||||
state.exclusive_waiting_blocked=false;
|
||||
release_waiters();
|
||||
@@ -300,7 +300,7 @@ namespace boost
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
state.exclusive_waiting_blocked=true;
|
||||
if(!exclusive_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock, boost::ref(state))))
|
||||
if(!exclusive_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock, &state)))
|
||||
{
|
||||
state.exclusive_waiting_blocked=false;
|
||||
release_waiters();
|
||||
@@ -324,7 +324,7 @@ namespace boost
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
state.exclusive_waiting_blocked=true;
|
||||
if(!exclusive_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock, boost::ref(state))))
|
||||
if(!exclusive_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock, &state)))
|
||||
{
|
||||
state.exclusive_waiting_blocked=false;
|
||||
release_waiters();
|
||||
@@ -362,7 +362,7 @@ namespace boost
|
||||
boost::this_thread::disable_interruption do_not_disturb;
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
shared_cond.wait(lk, boost::bind(&state_data::can_lock_upgrade, boost::ref(state)));
|
||||
shared_cond.wait(lk, boost::bind(&state_data::can_lock_upgrade, &state));
|
||||
state.lock_shared();
|
||||
state.upgrade=true;
|
||||
}
|
||||
@@ -374,7 +374,7 @@ namespace boost
|
||||
boost::this_thread::disable_interruption do_not_disturb;
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
if(!shared_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock_upgrade, boost::ref(state))))
|
||||
if(!shared_cond.timed_wait(lk, timeout, boost::bind(&state_data::can_lock_upgrade, &state)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -390,7 +390,7 @@ namespace boost
|
||||
boost::this_thread::disable_interruption do_not_disturb;
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
if(!shared_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock_upgrade, boost::ref(state))))
|
||||
if(!shared_cond.timed_wait(lk, relative_time, boost::bind(&state_data::can_lock_upgrade, &state)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -412,7 +412,7 @@ namespace boost
|
||||
boost::this_thread::disable_interruption do_not_disturb;
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_upgrade, boost::ref(state))))
|
||||
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_upgrade, &state)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -457,7 +457,7 @@ namespace boost
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
state.assert_lock_upgraded();
|
||||
state.unlock_shared();
|
||||
upgrade_cond.wait(lk, boost::bind(&state_data::no_shared, boost::ref(state)));
|
||||
upgrade_cond.wait(lk, boost::bind(&state_data::no_shared, &state));
|
||||
state.upgrade=false;
|
||||
state.exclusive=true;
|
||||
state.assert_locked();
|
||||
@@ -511,7 +511,7 @@ namespace boost
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
state.assert_lock_upgraded();
|
||||
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::one_shared, boost::ref(state))))
|
||||
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::one_shared, &state)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -569,7 +569,7 @@ namespace boost
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
state.assert_lock_shared();
|
||||
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::one_shared, boost::ref(state))))
|
||||
if(!shared_cond.wait_until(lk, abs_time, boost::bind(&state_data::one_shared, &state)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -623,7 +623,7 @@ namespace boost
|
||||
#endif
|
||||
boost::unique_lock<boost::mutex> lk(state_change);
|
||||
state.assert_lock_shared();
|
||||
if(!exclusive_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_upgrade, boost::ref(state))))
|
||||
if(!exclusive_cond.wait_until(lk, abs_time, boost::bind(&state_data::can_lock_upgrade, &state)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -275,9 +275,9 @@ namespace boost {
|
||||
inline void shared_mutex::lock()
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
gate1_.wait(lk, boost::bind(&shared_mutex::no_writer, boost::ref(*this)));
|
||||
gate1_.wait(lk, boost::bind(&shared_mutex::no_writer, this));
|
||||
state_ |= write_entered_;
|
||||
gate2_.wait(lk, boost::bind(&shared_mutex::no_readers, boost::ref(*this)));
|
||||
gate2_.wait(lk, boost::bind(&shared_mutex::no_readers, this));
|
||||
}
|
||||
|
||||
inline bool shared_mutex::try_lock()
|
||||
@@ -298,13 +298,13 @@ namespace boost {
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
if (!gate1_.wait_until(lk, abs_time, boost::bind(
|
||||
&shared_mutex::no_writer, boost::ref(*this))))
|
||||
&shared_mutex::no_writer, this)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
state_ |= write_entered_;
|
||||
if (!gate2_.wait_until(lk, abs_time, boost::bind(
|
||||
&shared_mutex::no_readers, boost::ref(*this))))
|
||||
&shared_mutex::no_readers, this)))
|
||||
{
|
||||
state_ &= ~write_entered_;
|
||||
return false;
|
||||
@@ -319,13 +319,13 @@ namespace boost {
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind(
|
||||
&shared_mutex::no_writer, boost::ref(*this))))
|
||||
&shared_mutex::no_writer, this)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
state_ |= write_entered_;
|
||||
if (!gate2_.timed_wait(lk, abs_or_rel_time, boost::bind(
|
||||
&shared_mutex::no_readers, boost::ref(*this))))
|
||||
&shared_mutex::no_readers, this)))
|
||||
{
|
||||
state_ &= ~write_entered_;
|
||||
return false;
|
||||
@@ -350,7 +350,7 @@ namespace boost {
|
||||
inline void shared_mutex::lock_shared()
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
gate1_.wait(lk, boost::bind(&shared_mutex::no_writer_no_max_readers, boost::ref(*this)));
|
||||
gate1_.wait(lk, boost::bind(&shared_mutex::no_writer_no_max_readers, this));
|
||||
count_t num_readers = (state_ & n_readers_) + 1;
|
||||
state_ &= ~n_readers_;
|
||||
state_ |= num_readers;
|
||||
@@ -376,7 +376,7 @@ namespace boost {
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
if (!gate1_.wait_until(lk, abs_time, boost::bind(
|
||||
&shared_mutex::no_writer_no_max_readers, boost::ref(*this))))
|
||||
&shared_mutex::no_writer_no_max_readers, this)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -393,7 +393,7 @@ namespace boost {
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind(
|
||||
&shared_mutex::no_writer_no_max_readers, boost::ref(*this))))
|
||||
&shared_mutex::no_writer_no_max_readers, this)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -653,9 +653,9 @@ namespace boost {
|
||||
inline void upgrade_mutex::lock()
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
gate1_.wait(lk, boost::bind(&upgrade_mutex::no_writer_no_upgrader, boost::ref(*this)));
|
||||
gate1_.wait(lk, boost::bind(&upgrade_mutex::no_writer_no_upgrader, this));
|
||||
state_ |= write_entered_;
|
||||
gate2_.wait(lk, boost::bind(&upgrade_mutex::no_readers, boost::ref(*this)));
|
||||
gate2_.wait(lk, boost::bind(&upgrade_mutex::no_readers, this));
|
||||
}
|
||||
|
||||
inline bool upgrade_mutex::try_lock()
|
||||
@@ -676,13 +676,13 @@ namespace boost {
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
if (!gate1_.wait_until(lk, abs_time, boost::bind(
|
||||
&upgrade_mutex::no_writer_no_upgrader, boost::ref(*this))))
|
||||
&upgrade_mutex::no_writer_no_upgrader, this)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
state_ |= write_entered_;
|
||||
if (!gate2_.wait_until(lk, abs_time, boost::bind(
|
||||
&upgrade_mutex::no_readers, boost::ref(*this))))
|
||||
&upgrade_mutex::no_readers, this)))
|
||||
{
|
||||
state_ &= ~write_entered_;
|
||||
return false;
|
||||
@@ -697,13 +697,13 @@ namespace boost {
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind(
|
||||
&upgrade_mutex::no_writer_no_upgrader, boost::ref(*this))))
|
||||
&upgrade_mutex::no_writer_no_upgrader, this)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
state_ |= write_entered_;
|
||||
if (!gate2_.timed_wait(lk, abs_or_rel_time, boost::bind(
|
||||
&upgrade_mutex::no_readers, boost::ref(*this))))
|
||||
&upgrade_mutex::no_readers, this)))
|
||||
{
|
||||
state_ &= ~write_entered_;
|
||||
return false;
|
||||
@@ -729,7 +729,7 @@ namespace boost {
|
||||
inline void upgrade_mutex::lock_shared()
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
gate1_.wait(lk, boost::bind(&upgrade_mutex::no_writer_no_max_readers, boost::ref(*this)));
|
||||
gate1_.wait(lk, boost::bind(&upgrade_mutex::no_writer_no_max_readers, this));
|
||||
count_t num_readers = (state_ & n_readers_) + 1;
|
||||
state_ &= ~n_readers_;
|
||||
state_ |= num_readers;
|
||||
@@ -755,7 +755,7 @@ namespace boost {
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
if (!gate1_.wait_until(lk, abs_time, boost::bind(
|
||||
&upgrade_mutex::no_writer_no_max_readers, boost::ref(*this))))
|
||||
&upgrade_mutex::no_writer_no_max_readers, this)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -772,7 +772,7 @@ namespace boost {
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind(
|
||||
&upgrade_mutex::no_writer_no_max_readers, boost::ref(*this))))
|
||||
&upgrade_mutex::no_writer_no_max_readers, this)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -807,7 +807,7 @@ namespace boost {
|
||||
inline void upgrade_mutex::lock_upgrade()
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
gate1_.wait(lk, boost::bind(&upgrade_mutex::no_writer_no_upgrader_no_max_readers, boost::ref(*this)));
|
||||
gate1_.wait(lk, boost::bind(&upgrade_mutex::no_writer_no_upgrader_no_max_readers, this));
|
||||
count_t num_readers = (state_ & n_readers_) + 1;
|
||||
state_ &= ~n_readers_;
|
||||
state_ |= upgradable_entered_ | num_readers;
|
||||
@@ -833,7 +833,7 @@ namespace boost {
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
if (!gate1_.wait_until(lk, abs_time, boost::bind(
|
||||
&upgrade_mutex::no_writer_no_upgrader_no_max_readers, boost::ref(*this))))
|
||||
&upgrade_mutex::no_writer_no_upgrader_no_max_readers, this)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -850,7 +850,7 @@ namespace boost {
|
||||
{
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
if (!gate1_.timed_wait(lk, abs_or_rel_time, boost::bind(
|
||||
&upgrade_mutex::no_writer_no_upgrader_no_max_readers, boost::ref(*this))))
|
||||
&upgrade_mutex::no_writer_no_upgrader_no_max_readers, this)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -898,7 +898,7 @@ namespace boost {
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
BOOST_ASSERT(one_or_more_readers());
|
||||
if (!gate1_.wait_until(lk, abs_time, boost::bind(
|
||||
&upgrade_mutex::no_writer_no_upgrader, boost::ref(*this))))
|
||||
&upgrade_mutex::no_writer_no_upgrader, this)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -906,7 +906,7 @@ namespace boost {
|
||||
state_ &= ~n_readers_;
|
||||
state_ |= (write_entered_ | num_readers);
|
||||
if (!gate2_.wait_until(lk, abs_time, boost::bind(
|
||||
&upgrade_mutex::no_readers, boost::ref(*this))))
|
||||
&upgrade_mutex::no_readers, this)))
|
||||
{
|
||||
++num_readers;
|
||||
state_ &= ~(write_entered_ | n_readers_);
|
||||
@@ -953,7 +953,7 @@ namespace boost {
|
||||
boost::unique_lock<mutex_t> lk(mut_);
|
||||
BOOST_ASSERT(one_or_more_readers());
|
||||
if (!gate1_.wait_until(lk, abs_time, boost::bind(
|
||||
&upgrade_mutex::no_writer_no_upgrader, boost::ref(*this))))
|
||||
&upgrade_mutex::no_writer_no_upgrader, this)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -987,7 +987,7 @@ namespace boost {
|
||||
count_t num_readers = (state_ & n_readers_) - 1;
|
||||
state_ &= ~(upgradable_entered_ | n_readers_);
|
||||
state_ |= write_entered_ | num_readers;
|
||||
gate2_.wait(lk, boost::bind(&upgrade_mutex::no_readers, boost::ref(*this)));
|
||||
gate2_.wait(lk, boost::bind(&upgrade_mutex::no_readers, this));
|
||||
}
|
||||
|
||||
inline bool upgrade_mutex::try_unlock_upgrade_and_lock()
|
||||
@@ -1017,7 +1017,7 @@ namespace boost {
|
||||
state_ &= ~(upgradable_entered_ | n_readers_);
|
||||
state_ |= (write_entered_ | num_readers);
|
||||
if (!gate2_.wait_until(lk, abs_time, boost::bind(
|
||||
&upgrade_mutex::no_readers, boost::ref(*this))))
|
||||
&upgrade_mutex::no_readers, this)))
|
||||
{
|
||||
++num_readers;
|
||||
state_ &= ~(write_entered_ | n_readers_);
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
#include <boost/thread/detail/move.hpp>
|
||||
#include <boost/thread/detail/invoke.hpp>
|
||||
|
||||
#if !defined(BOOST_THREAD_PROVIDES_INVOKE) && !defined(BOOST_THREAD_PROVIDES_INVOKE_RET)
|
||||
#include <boost/bind/bind.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
|
||||
@@ -152,7 +154,7 @@ namespace boost
|
||||
{
|
||||
name_once_mutex(mutex_name,flag_address);
|
||||
}
|
||||
|
||||
|
||||
return ::boost::detail::win32::create_event(
|
||||
mutex_name,
|
||||
::boost::detail::win32::manual_reset_event,
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/atomic.hpp>
|
||||
#include <boost/memory_order.hpp>
|
||||
#include <boost/atomic/atomic.hpp>
|
||||
#include <pthread.h>
|
||||
|
||||
namespace boost
|
||||
|
||||
+48
-46
@@ -21,6 +21,7 @@
|
||||
#include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
|
||||
#include <boost/thread/detail/string_trim.hpp>
|
||||
#include <boost/thread/detail/string_to_unsigned.hpp>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
|
||||
#ifdef __GLIBC__
|
||||
#include <sys/sysinfo.h>
|
||||
@@ -185,7 +186,7 @@ namespace boost
|
||||
// Unhandled exceptions still cause the application to terminate
|
||||
// BOOST_CATCH(...)
|
||||
// {
|
||||
// throw;
|
||||
// throw;
|
||||
//
|
||||
// std::terminate();
|
||||
// }
|
||||
@@ -212,12 +213,13 @@ namespace boost
|
||||
interrupt_enabled=false;
|
||||
#endif
|
||||
}
|
||||
~externally_launched_thread() {
|
||||
BOOST_ASSERT(notify.empty());
|
||||
notify.clear();
|
||||
~externally_launched_thread()
|
||||
{
|
||||
BOOST_ASSERT(notify.empty());
|
||||
notify.clear();
|
||||
//#ifndef BOOST_NO_EXCEPTIONS
|
||||
BOOST_ASSERT(async_states_.empty());
|
||||
async_states_.clear();
|
||||
BOOST_ASSERT(async_states_.empty());
|
||||
async_states_.clear();
|
||||
//#endif
|
||||
}
|
||||
void run()
|
||||
@@ -354,7 +356,7 @@ namespace boost
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,8 +375,8 @@ namespace boost
|
||||
}
|
||||
if(!local_thread_info->done)
|
||||
{
|
||||
res=false;
|
||||
return true;
|
||||
res=false;
|
||||
return true;
|
||||
}
|
||||
do_join=!local_thread_info->join_started;
|
||||
|
||||
@@ -437,31 +439,31 @@ namespace boost
|
||||
|
||||
namespace this_thread
|
||||
{
|
||||
namespace no_interruption_point
|
||||
{
|
||||
namespace hidden
|
||||
namespace no_interruption_point
|
||||
{
|
||||
void BOOST_THREAD_DECL sleep_for_internal(const detail::platform_duration& ts)
|
||||
{
|
||||
if (ts > detail::platform_duration::zero())
|
||||
namespace hidden
|
||||
{
|
||||
void BOOST_THREAD_DECL sleep_for_internal(const detail::platform_duration& ts)
|
||||
{
|
||||
// Use pthread_delay_np or nanosleep whenever possible here in the no_interruption_point
|
||||
// namespace because they do not provide an interruption point.
|
||||
# if defined(BOOST_HAS_PTHREAD_DELAY_NP)
|
||||
# if defined(__IBMCPP__) || defined(_AIX)
|
||||
BOOST_VERIFY(!pthread_delay_np(const_cast<timespec*>(&ts.getTs())));
|
||||
# else
|
||||
BOOST_VERIFY(!pthread_delay_np(&ts.getTs()));
|
||||
# endif
|
||||
# elif defined(BOOST_HAS_NANOSLEEP)
|
||||
nanosleep(&ts.getTs(), 0);
|
||||
# else
|
||||
// This should never be reached due to BOOST_THREAD_SLEEP_FOR_IS_STEADY
|
||||
# endif
|
||||
if (ts > detail::platform_duration::zero())
|
||||
{
|
||||
// Use pthread_delay_np or nanosleep whenever possible here in the no_interruption_point
|
||||
// namespace because they do not provide an interruption point.
|
||||
# if defined(BOOST_HAS_PTHREAD_DELAY_NP)
|
||||
# if defined(__IBMCPP__) || defined(_AIX)
|
||||
BOOST_VERIFY(!pthread_delay_np(const_cast<timespec*>(&ts.getTs())));
|
||||
# else
|
||||
BOOST_VERIFY(!pthread_delay_np(&ts.getTs()));
|
||||
# endif
|
||||
# elif defined(BOOST_HAS_NANOSLEEP)
|
||||
nanosleep(&ts.getTs(), 0);
|
||||
# else
|
||||
// This should never be reached due to BOOST_THREAD_SLEEP_FOR_IS_STEADY
|
||||
# endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void yield() BOOST_NOEXCEPT
|
||||
{
|
||||
@@ -515,7 +517,7 @@ namespace boost
|
||||
unsigned thread::physical_concurrency() BOOST_NOEXCEPT
|
||||
{
|
||||
#ifdef __linux__
|
||||
try {
|
||||
BOOST_TRY {
|
||||
using namespace std;
|
||||
|
||||
ifstream proc_cpuinfo ("/proc/cpuinfo");
|
||||
@@ -570,9 +572,10 @@ namespace boost
|
||||
// Fall back to hardware_concurrency() in case
|
||||
// /proc/cpuinfo is formatted differently than we expect.
|
||||
return cores.size() != 0 ? cores.size() : hardware_concurrency();
|
||||
} catch(...) {
|
||||
return hardware_concurrency();
|
||||
} BOOST_CATCH(...) {
|
||||
return hardware_concurrency();
|
||||
}
|
||||
BOOST_CATCH_END
|
||||
#elif defined(__APPLE__)
|
||||
int count;
|
||||
size_t size=sizeof(count);
|
||||
@@ -786,26 +789,25 @@ namespace boost
|
||||
|
||||
BOOST_THREAD_DECL void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk)
|
||||
{
|
||||
detail::thread_data_base* const current_thread_data(detail::get_current_thread_data());
|
||||
if(current_thread_data)
|
||||
{
|
||||
current_thread_data->notify_all_at_thread_exit(&cond, lk.release());
|
||||
}
|
||||
detail::thread_data_base* const current_thread_data(detail::get_current_thread_data());
|
||||
if(current_thread_data)
|
||||
{
|
||||
current_thread_data->notify_all_at_thread_exit(&cond, lk.release());
|
||||
}
|
||||
}
|
||||
|
||||
//#ifndef BOOST_NO_EXCEPTIONS
|
||||
namespace detail {
|
||||
|
||||
namespace detail
|
||||
{
|
||||
void BOOST_THREAD_DECL make_ready_at_thread_exit(shared_ptr<shared_state_base> as)
|
||||
{
|
||||
detail::thread_data_base* const current_thread_data(detail::get_current_thread_data());
|
||||
if(current_thread_data)
|
||||
{
|
||||
current_thread_data->make_ready_at_thread_exit(as);
|
||||
}
|
||||
detail::thread_data_base* const current_thread_data(detail::get_current_thread_data());
|
||||
if(current_thread_data)
|
||||
{
|
||||
current_thread_data->make_ready_at_thread_exit(as);
|
||||
}
|
||||
}
|
||||
}
|
||||
//#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
+13
-4
@@ -29,15 +29,16 @@
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include <boost/predef/platform.h>
|
||||
#include <boost/core/no_exceptions_support.hpp>
|
||||
|
||||
#if BOOST_PLAT_WINDOWS_RUNTIME
|
||||
#include <mutex>
|
||||
#include <atomic>
|
||||
#include <Activation.h>
|
||||
#include <wrl\client.h>
|
||||
#include <wrl\event.h>
|
||||
#include <wrl\wrappers\corewrappers.h>
|
||||
#include <wrl\ftm.h>
|
||||
#include <wrl/client.h>
|
||||
#include <wrl/event.h>
|
||||
#include <wrl/wrappers/corewrappers.h>
|
||||
#include <wrl/ftm.h>
|
||||
#include <windows.system.threading.h>
|
||||
#pragma comment(lib, "runtimeobject.lib")
|
||||
#endif
|
||||
@@ -577,10 +578,18 @@ namespace boost
|
||||
} Reason;
|
||||
} REASON_CONTEXT, *PREASON_CONTEXT;
|
||||
typedef BOOL (WINAPI *setwaitabletimerex_t)(HANDLE, const LARGE_INTEGER *, LONG, PTIMERAPCROUTINE, LPVOID, PREASON_CONTEXT, ULONG);
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4100) // unreferenced formal parameter
|
||||
#endif
|
||||
static inline BOOL WINAPI SetWaitableTimerEx_emulation(HANDLE hTimer, const LARGE_INTEGER *lpDueTime, LONG lPeriod, PTIMERAPCROUTINE pfnCompletionRoutine, LPVOID lpArgToCompletionRoutine, PREASON_CONTEXT WakeContext, ULONG TolerableDelay)
|
||||
{
|
||||
return SetWaitableTimer(hTimer, lpDueTime, lPeriod, pfnCompletionRoutine, lpArgToCompletionRoutine, FALSE);
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 6387) // MSVC sanitiser warns that GetModuleHandleA() might fail
|
||||
|
||||
+20
-18
@@ -110,18 +110,18 @@ project
|
||||
<toolset>msvc:<cxxflags>/wd6246
|
||||
;
|
||||
|
||||
rule thread-run ( sources )
|
||||
rule thread-run ( sources : reqs * )
|
||||
{
|
||||
sources = $(sources) winrt_init.cpp ;
|
||||
return
|
||||
[ run $(sources) ../build//boost_thread ]
|
||||
[ run $(sources) ../build//boost_thread : : : $(reqs) ]
|
||||
[ run $(sources) ../src/tss_null.cpp ../build//boost_thread/<link>static
|
||||
: : : : $(sources[1]:B)_lib ]
|
||||
: : : $(reqs) : $(sources[1]:B)_lib ]
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
rule thread-test ( sources )
|
||||
rule thread-test ( sources : reqs * )
|
||||
{
|
||||
sources = $(sources) winrt_init.cpp ;
|
||||
return
|
||||
@@ -136,14 +136,14 @@ rule thread-test ( sources )
|
||||
;
|
||||
}
|
||||
|
||||
rule thread-run2 ( sources : name )
|
||||
rule thread-run2 ( sources : name : reqs * )
|
||||
{
|
||||
sources = $(sources) winrt_init.cpp ;
|
||||
return
|
||||
[ run $(sources) ../build//boost_thread : : :
|
||||
[ run $(sources) ../build//boost_thread : : : $(reqs)
|
||||
: $(name) ]
|
||||
[ run $(sources) ../src/tss_null.cpp ../build//boost_thread/<link>static
|
||||
: : :
|
||||
: : : $(reqs)
|
||||
: $(name)_lib ]
|
||||
;
|
||||
}
|
||||
@@ -268,16 +268,15 @@ rule generate_self_contained_header_tests
|
||||
|
||||
if ! [ os.environ BOOST_THREAD_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ]
|
||||
{
|
||||
local headers_path = [ path.make $(BOOST_ROOT)/libs/thread/include/boost/thread ] ;
|
||||
for file in [ path.glob-tree $(headers_path) : *.hpp : detail pthread win32 ]
|
||||
for file in [ glob-tree-ex ../include/boost/thread : *.hpp : detail pthread win32 ]
|
||||
{
|
||||
local rel_file = [ path.relative-to $(headers_path) $(file) ] ;
|
||||
local rel_file = [ path.relative-to ../include/boost/thread $(file) ] ;
|
||||
# Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end.
|
||||
# All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes.
|
||||
local test_name = [ regex.replace ~hdr/$(rel_file) "/" "-" ] ;
|
||||
#ECHO $(rel_file) ;
|
||||
all_rules += [ compile self_contained_header.cpp : <define>"BOOST_THREAD_TEST_HEADER=$(rel_file)" <dependency>$(file) : $(test_name) ] ;
|
||||
all_rules += [ compile self_contained_header.cpp : <define>"BOOST_THREAD_TEST_HEADER=$(rel_file)" <define>"BOOST_THREAD_TEST_POST_WINDOWS_H" <dependency>$(file) <conditional>@windows-cygwin-specific : $(test_name)-post_winh ] ;
|
||||
all_rules += [ compile self_contained_header.cpp : <define>"BOOST_THREAD_TEST_HEADER=$(rel_file)" <dependency>$(file) <use>../build//boost_thread : $(test_name) ] ;
|
||||
all_rules += [ compile self_contained_header.cpp : <define>"BOOST_THREAD_TEST_HEADER=$(rel_file)" <define>"BOOST_THREAD_TEST_POST_WINDOWS_H" <dependency>$(file) <conditional>@windows-cygwin-specific <use>../build//boost_thread : $(test_name)-post_winh ] ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +362,10 @@ rule generate_self_contained_header_tests
|
||||
[ thread-run test_7571.cpp ]
|
||||
[ thread-run test_9319.cpp ]
|
||||
#[ thread-run test_9711.cpp ] This is an invalid use of ::then deferred.
|
||||
[ thread-run test_9856.cpp ]
|
||||
[ thread-run test_9856.cpp :
|
||||
<toolset>gcc:<cxxflags>-fopenmp
|
||||
<toolset>gcc:<linkflags>-fopenmp
|
||||
]
|
||||
[ thread-compile test_10963.cpp : : test_10963_c ]
|
||||
[ thread-run test_10964.cpp ]
|
||||
[ thread-test test_11053.cpp ]
|
||||
@@ -1012,7 +1014,7 @@ rule generate_self_contained_header_tests
|
||||
#[ thread-run test_10128.cpp ]
|
||||
#[ thread-run test_10340.cpp ]
|
||||
;
|
||||
|
||||
|
||||
explicit ts_more_cpp11 ;
|
||||
test-suite ts_more_cpp11
|
||||
:
|
||||
@@ -1033,13 +1035,13 @@ rule generate_self_contained_header_tests
|
||||
:
|
||||
[ thread-run2-noit ./experimental/parallel/v1/exception_list_pass.cpp : exception_list_p ]
|
||||
;
|
||||
|
||||
|
||||
#explicit ts_task_region ;
|
||||
test-suite ts_task_region
|
||||
:
|
||||
[ thread-run2-noit ./experimental/parallel/v2/task_region_pass.cpp : task_region_p ]
|
||||
;
|
||||
|
||||
|
||||
explicit ts_other ;
|
||||
test-suite ts_other
|
||||
:
|
||||
@@ -1050,7 +1052,7 @@ rule generate_self_contained_header_tests
|
||||
explicit ts_ ;
|
||||
test-suite ts_
|
||||
:
|
||||
#[ thread-run test_11256.cpp ]
|
||||
#[ thread-run test_11256.cpp ]
|
||||
#[ thread-run test_11256.cpp ]
|
||||
#[ thread-run test_11499.cpp ]
|
||||
#[ thread-run test_11611.cpp ]
|
||||
@@ -1060,7 +1062,7 @@ rule generate_self_contained_header_tests
|
||||
#[ thread-run test_12949.cpp ]
|
||||
#[ thread-run test_13480b.cpp ]
|
||||
[ thread-run test_13561.cpp ]
|
||||
|
||||
|
||||
;
|
||||
|
||||
explicit test_time_jumps_1_obj ;
|
||||
|
||||
@@ -30,12 +30,16 @@ struct wait_for_flag
|
||||
flag(flag_)
|
||||
{}
|
||||
|
||||
check_flag(check_flag const& that):
|
||||
flag(that.flag)
|
||||
{}
|
||||
|
||||
bool operator()() const
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
private:
|
||||
void operator=(check_flag&);
|
||||
check_flag& operator=(check_flag const&);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include <boost/thread/experimental/parallel/v1/exception_list.hpp>
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
|
||||
int main()
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <boost/thread/experimental/parallel/v2/task_region.hpp>
|
||||
#include <string>
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#if ! defined BOOST_NO_CXX11_LAMBDAS && defined(BOOST_THREAD_PROVIDES_INVOKE)
|
||||
using boost::experimental::parallel::v2::task_region;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// <boost/thread/detail/invoke.hpp>
|
||||
|
||||
#include <boost/thread/detail/invoke.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int f()
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// <boost/thread/detail/invoke.hpp>
|
||||
|
||||
#include <boost/thread/detail/invoke.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int count = 0;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// <boost/thread/detail/invoke.hpp>
|
||||
|
||||
#include <boost/thread/detail/invoke.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int count = 0;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// <boost/thread/detail/invoker.hpp>
|
||||
|
||||
#include <boost/thread/detail/invoker.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int f()
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// <boost/thread/detail/invoker.hpp>
|
||||
|
||||
#include <boost/thread/detail/invoker.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int count = 0;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/thread/detail/invoker.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int count = 0;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// condition_variable(const condition_variable&) = delete;
|
||||
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
void fail()
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// condition_variable(const condition_variable&) = delete;
|
||||
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/thread/locks.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
boost::condition_variable* cv;
|
||||
boost::mutex m;
|
||||
boost::condition_variable* g_cv;
|
||||
boost::mutex g_mutex;
|
||||
typedef boost::unique_lock<boost::mutex> Lock;
|
||||
|
||||
bool f_ready = false;
|
||||
@@ -32,33 +32,33 @@ bool g_ready = false;
|
||||
|
||||
void f()
|
||||
{
|
||||
Lock lk(m);
|
||||
Lock lk(g_mutex);
|
||||
f_ready = true;
|
||||
cv->notify_one();
|
||||
cv->wait(lk);
|
||||
delete cv;
|
||||
g_cv->notify_one();
|
||||
g_cv->wait(lk);
|
||||
delete g_cv;
|
||||
}
|
||||
|
||||
void g()
|
||||
{
|
||||
Lock lk(m);
|
||||
Lock lk(g_mutex);
|
||||
g_ready = true;
|
||||
cv->notify_one();
|
||||
g_cv->notify_one();
|
||||
while (!f_ready)
|
||||
{
|
||||
cv->wait(lk);
|
||||
g_cv->wait(lk);
|
||||
}
|
||||
cv->notify_one();
|
||||
g_cv->notify_one();
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
cv = new boost::condition_variable;
|
||||
g_cv = new boost::condition_variable;
|
||||
boost::thread th2(g);
|
||||
Lock lk(m);
|
||||
Lock lk(g_mutex);
|
||||
while (!g_ready)
|
||||
{
|
||||
cv->wait(lk);
|
||||
g_cv->wait(lk);
|
||||
}
|
||||
lk.unlock();
|
||||
boost::thread th1(f);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <cassert>
|
||||
|
||||
// Summary of each test:
|
||||
@@ -60,7 +60,7 @@ bool threadIsWaiting()
|
||||
|
||||
#ifdef BOOST_THREAD_USES_DATETIME
|
||||
|
||||
boost::posix_time::milliseconds posix_wait_time(1000);
|
||||
boost::posix_time::milliseconds posix_wait_time(2000);
|
||||
|
||||
template <typename F>
|
||||
void test_posix_wait_function(F f)
|
||||
@@ -68,12 +68,14 @@ void test_posix_wait_function(F f)
|
||||
flag = false;
|
||||
waiting = false;
|
||||
boost::thread t(f);
|
||||
boost::unique_lock<boost::mutex> lk(mut);
|
||||
while (!threadIsWaiting())
|
||||
{
|
||||
boost::this_thread::sleep(boost::posix_time::milliseconds(1));
|
||||
lk.unlock();
|
||||
boost::this_thread::sleep(boost::posix_time::milliseconds(10));
|
||||
lk.lock();
|
||||
}
|
||||
|
||||
boost::unique_lock<boost::mutex> lk(mut);
|
||||
boost::this_thread::sleep(boost::posix_time::milliseconds(500));
|
||||
boost::posix_time::ptime t0 = boost::posix_time::microsec_clock::universal_time();
|
||||
flag = true;
|
||||
@@ -82,7 +84,7 @@ void test_posix_wait_function(F f)
|
||||
t.join();
|
||||
boost::posix_time::ptime t1 = boost::posix_time::microsec_clock::universal_time();
|
||||
|
||||
BOOST_TEST(t1 - t0 < boost::posix_time::milliseconds(250));
|
||||
BOOST_TEST(t1 - t0 < boost::posix_time::milliseconds(500));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -131,7 +133,7 @@ void timed_wait_relative_with_pred()
|
||||
|
||||
#ifdef BOOST_THREAD_USES_CHRONO
|
||||
|
||||
boost::chrono::milliseconds chrono_wait_time(1000);
|
||||
boost::chrono::milliseconds chrono_wait_time(2000);
|
||||
|
||||
template <typename F>
|
||||
void test_chrono_wait_function(F f)
|
||||
@@ -139,12 +141,14 @@ void test_chrono_wait_function(F f)
|
||||
flag = false;
|
||||
waiting = false;
|
||||
boost::thread t(f);
|
||||
boost::unique_lock<boost::mutex> lk(mut);
|
||||
while (!threadIsWaiting())
|
||||
{
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(1));
|
||||
lk.unlock();
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(10));
|
||||
lk.lock();
|
||||
}
|
||||
|
||||
boost::unique_lock<boost::mutex> lk(mut);
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
|
||||
boost::chrono::steady_clock::time_point t0 = boost::chrono::steady_clock::now();
|
||||
flag = true;
|
||||
@@ -153,7 +157,7 @@ void test_chrono_wait_function(F f)
|
||||
t.join();
|
||||
boost::chrono::steady_clock::time_point t1 = boost::chrono::steady_clock::now();
|
||||
|
||||
BOOST_TEST(t1 - t0 < boost::chrono::milliseconds(250));
|
||||
BOOST_TEST(t1 - t0 < boost::chrono::milliseconds(500));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <cassert>
|
||||
#include "../../../timming.hpp"
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include "../../../timming.hpp"
|
||||
@@ -55,7 +56,7 @@ typedef boost::chrono::milliseconds milliseconds;
|
||||
typedef boost::chrono::milliseconds ms;
|
||||
typedef boost::chrono::nanoseconds ns;
|
||||
|
||||
const ms max_diff(BOOST_THREAD_TEST_TIME_MS);
|
||||
BOOST_ATTRIBUTE_UNUSED const ms max_diff(BOOST_THREAD_TEST_TIME_MS);
|
||||
|
||||
void f()
|
||||
{
|
||||
@@ -64,9 +65,11 @@ void f()
|
||||
assert(test2 == 0);
|
||||
test1 = 1;
|
||||
cv.notify_one();
|
||||
Clock::time_point t0 = Clock::now();
|
||||
BOOST_ATTRIBUTE_UNUSED Clock::time_point t0 = Clock::now();
|
||||
cv.wait_for(lk, milliseconds(250), Pred(test2));
|
||||
Clock::time_point t1 = Clock::now();
|
||||
BOOST_ATTRIBUTE_UNUSED Clock::time_point t1 = Clock::now();
|
||||
(void)t0;
|
||||
(void)t1;
|
||||
if (runs == 0)
|
||||
{
|
||||
assert(t1 - t0 < max_diff);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include "../../../timming.hpp"
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include "../../../timming.hpp"
|
||||
@@ -79,8 +80,9 @@ void f()
|
||||
cv.notify_one();
|
||||
Clock::time_point t0 = Clock::now();
|
||||
Clock::time_point t = t0 + Clock::duration(250);
|
||||
bool r = cv.wait_until(lk, t, Pred(test2));
|
||||
BOOST_ATTRIBUTE_UNUSED bool r = cv.wait_until(lk, t, Pred(test2));
|
||||
Clock::time_point t1 = Clock::now();
|
||||
(void)r;
|
||||
if (runs == 0)
|
||||
{
|
||||
assert(t1 - t0 < max_diff);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// condition_variable_any(const condition_variable_any&) = delete;
|
||||
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
void fail()
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// condition_variable_any(const condition_variable_any&) = delete;
|
||||
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/thread/locks.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
boost::condition_variable_any* cv;
|
||||
boost::timed_mutex m;
|
||||
boost::condition_variable_any* g_cv;
|
||||
boost::timed_mutex g_mutex;
|
||||
typedef boost::unique_lock<boost::timed_mutex> Lock;
|
||||
|
||||
bool f_ready = false;
|
||||
@@ -32,33 +32,33 @@ bool g_ready = false;
|
||||
|
||||
void f()
|
||||
{
|
||||
Lock lk(m);
|
||||
Lock lk(g_mutex);
|
||||
f_ready = true;
|
||||
cv->notify_one();
|
||||
cv->wait(lk);
|
||||
delete cv;
|
||||
g_cv->notify_one();
|
||||
g_cv->wait(lk);
|
||||
delete g_cv;
|
||||
}
|
||||
|
||||
void g()
|
||||
{
|
||||
Lock lk(m);
|
||||
Lock lk(g_mutex);
|
||||
g_ready = true;
|
||||
cv->notify_one();
|
||||
g_cv->notify_one();
|
||||
while (!f_ready)
|
||||
{
|
||||
cv->wait(lk);
|
||||
g_cv->wait(lk);
|
||||
}
|
||||
cv->notify_one();
|
||||
g_cv->notify_one();
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
cv = new boost::condition_variable_any;
|
||||
g_cv = new boost::condition_variable_any;
|
||||
boost::thread th2(g);
|
||||
Lock lk(m);
|
||||
Lock lk(g_mutex);
|
||||
while (!g_ready)
|
||||
{
|
||||
cv->wait(lk);
|
||||
g_cv->wait(lk);
|
||||
}
|
||||
lk.unlock();
|
||||
boost::thread th1(f);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <cassert>
|
||||
|
||||
// Summary of each test:
|
||||
@@ -60,7 +60,7 @@ bool threadIsWaiting()
|
||||
|
||||
#ifdef BOOST_THREAD_USES_DATETIME
|
||||
|
||||
boost::posix_time::milliseconds posix_wait_time(1000);
|
||||
boost::posix_time::milliseconds posix_wait_time(2000);
|
||||
|
||||
template <typename F>
|
||||
void test_posix_wait_function(F f)
|
||||
@@ -68,12 +68,14 @@ void test_posix_wait_function(F f)
|
||||
flag = false;
|
||||
waiting = false;
|
||||
boost::thread t(f);
|
||||
boost::unique_lock<boost::mutex> lk(mut);
|
||||
while (!threadIsWaiting())
|
||||
{
|
||||
boost::this_thread::sleep(boost::posix_time::milliseconds(1));
|
||||
lk.unlock();
|
||||
boost::this_thread::sleep(boost::posix_time::milliseconds(10));
|
||||
lk.lock();
|
||||
}
|
||||
|
||||
boost::unique_lock<boost::mutex> lk(mut);
|
||||
boost::this_thread::sleep(boost::posix_time::milliseconds(500));
|
||||
boost::posix_time::ptime t0 = boost::posix_time::microsec_clock::universal_time();
|
||||
flag = true;
|
||||
@@ -82,7 +84,7 @@ void test_posix_wait_function(F f)
|
||||
t.join();
|
||||
boost::posix_time::ptime t1 = boost::posix_time::microsec_clock::universal_time();
|
||||
|
||||
BOOST_TEST(t1 - t0 < boost::posix_time::milliseconds(250));
|
||||
BOOST_TEST(t1 - t0 < boost::posix_time::milliseconds(500));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -131,7 +133,7 @@ void timed_wait_relative_with_pred()
|
||||
|
||||
#ifdef BOOST_THREAD_USES_CHRONO
|
||||
|
||||
boost::chrono::milliseconds chrono_wait_time(1000);
|
||||
boost::chrono::milliseconds chrono_wait_time(2000);
|
||||
|
||||
template <typename F>
|
||||
void test_chrono_wait_function(F f)
|
||||
@@ -139,12 +141,14 @@ void test_chrono_wait_function(F f)
|
||||
flag = false;
|
||||
waiting = false;
|
||||
boost::thread t(f);
|
||||
boost::unique_lock<boost::mutex> lk(mut);
|
||||
while (!threadIsWaiting())
|
||||
{
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(1));
|
||||
lk.unlock();
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(10));
|
||||
lk.lock();
|
||||
}
|
||||
|
||||
boost::unique_lock<boost::mutex> lk(mut);
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
|
||||
boost::chrono::steady_clock::time_point t0 = boost::chrono::steady_clock::now();
|
||||
flag = true;
|
||||
@@ -153,7 +157,7 @@ void test_chrono_wait_function(F f)
|
||||
t.join();
|
||||
boost::chrono::steady_clock::time_point t1 = boost::chrono::steady_clock::now();
|
||||
|
||||
BOOST_TEST(t1 - t0 < boost::chrono::milliseconds(250));
|
||||
BOOST_TEST(t1 - t0 < boost::chrono::milliseconds(500));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include "../../../timming.hpp"
|
||||
|
||||
#if defined BOOST_THREAD_USES_CHRONO
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include "../../../timming.hpp"
|
||||
|
||||
#if defined BOOST_THREAD_USES_CHRONO
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include "../../../timming.hpp"
|
||||
|
||||
#if defined BOOST_THREAD_USES_CHRONO
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include "../../../timming.hpp"
|
||||
|
||||
#if defined BOOST_THREAD_USES_CHRONO
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// static unsigned hardware_concurrency();
|
||||
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <boost/thread/locks.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/chrono/chrono.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
boost::condition_variable cv;
|
||||
boost::mutex mut;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <boost/thread/detail/memory.hpp>
|
||||
#include <boost/thread/csbl/memory/unique_ptr.hpp>
|
||||
#include <memory>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/thread/executors/basic_thread_pool.hpp>
|
||||
#include <boost/thread/executor.hpp>
|
||||
|
||||
@@ -106,12 +106,12 @@ int f0()
|
||||
return 3;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
int g_i = 0;
|
||||
|
||||
int& f1()
|
||||
{
|
||||
boost::this_thread::sleep_for(ms(200));
|
||||
return i;
|
||||
return g_i;
|
||||
}
|
||||
|
||||
void f2()
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <boost/thread/detail/memory.hpp>
|
||||
#include <boost/thread/csbl/memory/unique_ptr.hpp>
|
||||
#include <memory>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
typedef boost::chrono::high_resolution_clock Clock;
|
||||
typedef boost::chrono::milliseconds ms;
|
||||
@@ -109,12 +109,12 @@ int f0()
|
||||
return 3;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
int g_i = 0;
|
||||
|
||||
int& f1()
|
||||
{
|
||||
boost::this_thread::sleep_for(ms(200));
|
||||
return i;
|
||||
return g_i;
|
||||
}
|
||||
|
||||
void f2()
|
||||
@@ -153,8 +153,8 @@ struct check_timer {
|
||||
boost::chrono::nanoseconds delay;
|
||||
Clock::time_point start;
|
||||
check_timer(boost::chrono::nanoseconds delay)
|
||||
: delay(delay)
|
||||
, start(Clock::now())
|
||||
: delay(delay)
|
||||
, start(Clock::now())
|
||||
{
|
||||
}
|
||||
~check_timer() {
|
||||
@@ -490,7 +490,7 @@ int main()
|
||||
check_timer timer(ms(500));
|
||||
res = &f.get();
|
||||
}
|
||||
BOOST_TEST(res == &i);
|
||||
BOOST_TEST(res == &g_i);
|
||||
}
|
||||
catch (std::exception& ex)
|
||||
{
|
||||
@@ -513,7 +513,7 @@ int main()
|
||||
check_timer timer(ms(500));
|
||||
res = &f.get();
|
||||
}
|
||||
BOOST_TEST(res == &i);
|
||||
BOOST_TEST(res == &g_i);
|
||||
}
|
||||
catch (std::exception& ex)
|
||||
{
|
||||
@@ -536,7 +536,7 @@ int main()
|
||||
check_timer timer(ms(500));
|
||||
res = &f.get();
|
||||
}
|
||||
BOOST_TEST(res == &i);
|
||||
BOOST_TEST(res == &g_i);
|
||||
}
|
||||
catch (std::exception& ex)
|
||||
{
|
||||
@@ -560,7 +560,7 @@ int main()
|
||||
check_timer timer(ms(500));
|
||||
res = &f.get();
|
||||
}
|
||||
BOOST_TEST(res == &i);
|
||||
BOOST_TEST(res == &g_i);
|
||||
}
|
||||
catch (std::exception& ex)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <boost/thread/detail/log.hpp>
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#define BOOST_THREAD_VERSION 3
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#define BOOST_THREAD_VERSION 3
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define BOOST_THREAD_VERSION 3
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <boost/exception/exception.hpp>
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
|
||||
#include "../test_allocator.hpp"
|
||||
#endif
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/core/ref.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#if defined BOOST_THREAD_USES_CHRONO
|
||||
|
||||
@@ -51,13 +51,13 @@ void func2(boost::promise<int> p)
|
||||
p.set_exception(::make_exception_ptr(3));
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
int g_j = 0;
|
||||
|
||||
void func3(boost::promise<int&> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
|
||||
j = 5;
|
||||
p.set_value(j);
|
||||
g_j = 5;
|
||||
p.set_value(g_j);
|
||||
}
|
||||
|
||||
void func4(boost::promise<int&> p)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#if defined BOOST_THREAD_USES_CHRONO
|
||||
|
||||
@@ -61,13 +61,13 @@ void func2(boost::promise<int> p)
|
||||
p.set_exception(::make_exception_ptr(3));
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
int g_j = 0;
|
||||
|
||||
void func3(boost::promise<int&> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
|
||||
j = 5;
|
||||
p.set_value(j);
|
||||
g_j = 5;
|
||||
p.set_value(g_j);
|
||||
}
|
||||
|
||||
void func4(boost::promise<int&> p)
|
||||
|
||||
@@ -21,10 +21,7 @@
|
||||
#define BOOST_THREAD_VERSION 3
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
boost::mutex m0;
|
||||
boost::mutex m1;
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -21,9 +21,7 @@
|
||||
#define BOOST_THREAD_VERSION 3
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
boost::mutex m;
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -75,4 +73,3 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define BOOST_THREAD_VERSION 3
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <boost/thread/detail/log.hpp>
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <cassert>
|
||||
|
||||
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/thread/executors/basic_thread_pool.hpp>
|
||||
#include <boost/thread/executor.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <cassert>
|
||||
|
||||
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <boost/thread/detail/log.hpp>
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/chrono/chrono_io.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#if defined BOOST_THREAD_USES_CHRONO
|
||||
|
||||
@@ -56,13 +56,13 @@ void func1(boost::promise<int> p)
|
||||
p.set_value(3);
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
int g_j = 0;
|
||||
|
||||
void func3(boost::promise<int&> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(ms(500));
|
||||
j = 5;
|
||||
p.set_value(j);
|
||||
g_j = 5;
|
||||
p.set_value(g_j);
|
||||
}
|
||||
|
||||
void func5(boost::promise<void> p)
|
||||
@@ -86,13 +86,13 @@ int main()
|
||||
boost::thread(func1, boost::move(p)).detach();
|
||||
#endif
|
||||
BOOST_TEST(f.valid());
|
||||
BOOST_TEST_EQ(f.wait_for(ms(250)) , boost::future_status::timeout);
|
||||
BOOST_TEST_EQ(f.wait_for(ms(100)) , boost::future_status::timeout);
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
#else
|
||||
func1(boost::move(p));
|
||||
#endif
|
||||
BOOST_TEST(f.valid());
|
||||
BOOST_TEST_EQ(f.wait_for(ms(750)) , boost::future_status::ready);
|
||||
BOOST_TEST_EQ(f.wait_for(ms(2000)) , boost::future_status::ready);
|
||||
BOOST_TEST(f.valid());
|
||||
Clock::time_point t0 = Clock::now();
|
||||
f.wait();
|
||||
@@ -109,13 +109,13 @@ int main()
|
||||
boost::thread(func3, boost::move(p)).detach();
|
||||
#endif
|
||||
BOOST_TEST(f.valid());
|
||||
BOOST_TEST_EQ(f.wait_for(ms(250)) , boost::future_status::timeout);
|
||||
BOOST_TEST_EQ(f.wait_for(ms(100)) , boost::future_status::timeout);
|
||||
BOOST_TEST(f.valid());
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
#else
|
||||
func3(boost::move(p));
|
||||
#endif
|
||||
BOOST_TEST_EQ(f.wait_for(ms(750)) , boost::future_status::ready);
|
||||
BOOST_TEST_EQ(f.wait_for(ms(2000)) , boost::future_status::ready);
|
||||
BOOST_TEST(f.valid());
|
||||
Clock::time_point t0 = Clock::now();
|
||||
f.wait();
|
||||
@@ -132,13 +132,13 @@ int main()
|
||||
boost::thread(func5, boost::move(p)).detach();
|
||||
#endif
|
||||
BOOST_TEST(f.valid());
|
||||
BOOST_TEST_EQ(f.wait_for(ms(250)) , boost::future_status::timeout);
|
||||
BOOST_TEST_EQ(f.wait_for(ms(100)) , boost::future_status::timeout);
|
||||
BOOST_TEST(f.valid());
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
#else
|
||||
func5(boost::move(p));
|
||||
#endif
|
||||
BOOST_TEST_EQ(f.wait_for(ms(750)) , boost::future_status::ready);
|
||||
BOOST_TEST_EQ(f.wait_for(ms(2000)) , boost::future_status::ready);
|
||||
BOOST_TEST(f.valid());
|
||||
Clock::time_point t0 = Clock::now();
|
||||
f.wait();
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/chrono/chrono_io.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#if defined BOOST_THREAD_USES_CHRONO
|
||||
|
||||
@@ -54,13 +54,13 @@ void func1(boost::promise<int> p)
|
||||
p.set_value(3);
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
int g_j = 0;
|
||||
|
||||
void func3(boost::promise<int&> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(ms(500));
|
||||
j = 5;
|
||||
p.set_value(j);
|
||||
g_j = 5;
|
||||
p.set_value(g_j);
|
||||
}
|
||||
|
||||
void func5(boost::promise<void> p)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/chrono/chrono_io.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include "../../../timming.hpp"
|
||||
|
||||
#if defined BOOST_THREAD_USES_CHRONO
|
||||
@@ -57,13 +57,13 @@ void func1(boost::promise<int> p)
|
||||
p.set_value(3);
|
||||
}
|
||||
|
||||
int j = 0;
|
||||
int g_j = 0;
|
||||
|
||||
void func3(boost::promise<int&> p)
|
||||
{
|
||||
boost::this_thread::sleep_for(ms(500));
|
||||
j = 5;
|
||||
p.set_value(j);
|
||||
g_j = 5;
|
||||
p.set_value(g_j);
|
||||
}
|
||||
|
||||
void func5(boost::promise<void> p)
|
||||
@@ -87,13 +87,13 @@ int main()
|
||||
boost::thread(func1, boost::move(p)).detach();
|
||||
#endif
|
||||
BOOST_TEST(f.valid());
|
||||
BOOST_TEST_EQ(f.wait_until(Clock::now() + ms(250)) , boost::future_status::timeout);
|
||||
BOOST_TEST_EQ(f.wait_until(Clock::now() + ms(100)) , boost::future_status::timeout);
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
#else
|
||||
func1(boost::move(p));
|
||||
#endif
|
||||
BOOST_TEST(f.valid());
|
||||
BOOST_TEST_EQ(f.wait_until(Clock::now() + ms(750)) , boost::future_status::ready);
|
||||
BOOST_TEST_EQ(f.wait_until(Clock::now() + ms(2000)) , boost::future_status::ready);
|
||||
BOOST_TEST(f.valid());
|
||||
Clock::time_point t0 = Clock::now();
|
||||
f.wait();
|
||||
@@ -110,13 +110,13 @@ int main()
|
||||
boost::thread(func3, boost::move(p)).detach();
|
||||
#endif
|
||||
BOOST_TEST(f.valid());
|
||||
BOOST_TEST_EQ(f.wait_until(Clock::now() + ms(250)) , boost::future_status::timeout);
|
||||
BOOST_TEST_EQ(f.wait_until(Clock::now() + ms(100)) , boost::future_status::timeout);
|
||||
BOOST_TEST(f.valid());
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
#else
|
||||
func3(boost::move(p));
|
||||
#endif
|
||||
BOOST_TEST_EQ(f.wait_until(Clock::now() + ms(750)) , boost::future_status::ready);
|
||||
BOOST_TEST_EQ(f.wait_until(Clock::now() + ms(2000)) , boost::future_status::ready);
|
||||
BOOST_TEST(f.valid());
|
||||
Clock::time_point t0 = Clock::now();
|
||||
f.wait();
|
||||
@@ -133,13 +133,13 @@ int main()
|
||||
boost::thread(func5, boost::move(p)).detach();
|
||||
#endif
|
||||
BOOST_TEST(f.valid());
|
||||
BOOST_TEST_EQ(f.wait_until(Clock::now() + ms(250)) , boost::future_status::timeout);
|
||||
BOOST_TEST_EQ(f.wait_until(Clock::now() + ms(100)) , boost::future_status::timeout);
|
||||
BOOST_TEST(f.valid());
|
||||
#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
|
||||
#else
|
||||
func5(boost::move(p));
|
||||
#endif
|
||||
BOOST_TEST_EQ(f.wait_until(Clock::now() + ms(750)) , boost::future_status::ready);
|
||||
BOOST_TEST_EQ(f.wait_until(Clock::now() + ms(2000)) , boost::future_status::ready);
|
||||
BOOST_TEST(f.valid());
|
||||
Clock::time_point t0 = Clock::now();
|
||||
f.wait();
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#define BOOST_THREAD_VERSION 3
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
struct A
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <boost/thread/detail/config.hpp>
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
|
||||
#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
class A
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
class A
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <string>
|
||||
|
||||
int main()
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#if BOOST_THREAD_VERSION == 4
|
||||
#define BOOST_THREAD_DETAIL_SIGNATURE double()
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#define BOOST_THREAD_VERSION 4
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#if BOOST_THREAD_VERSION == 4
|
||||
#define BOOST_THREAD_DETAIL_SIGNATURE double()
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
class A
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define BOOST_THREAD_VERSION 4
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#if defined BOOST_THREAD_USES_CHRONO && \
|
||||
defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && \
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
class A
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
class A
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
class A
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
class A
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#define BOOST_THREAD_VERSION 4
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#if defined BOOST_THREAD_USES_CHRONO
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
class A
|
||||
{
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
struct A {};
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define BOOST_THREAD_VERSION 3
|
||||
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
|
||||
#include "../test_allocator.hpp"
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user