From ee609e8806b45aecbb6dba6fd1d0cc1383f28b55 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Tue, 3 Mar 2020 15:28:41 +0300 Subject: [PATCH 01/80] Cleanup header includes. 1. Make inclusion of boost/bind/bind.hpp conditional in some cases, when the code actually conditionally uses boost::bind. Reduces compile-time overhead and fixes https://github.com/boostorg/thread/issues/307. 2. Remove some unnecessary uses of boost::ref. This allows to avoid including boost/core/ref.hpp in a few places, and avoids the associated template instantiation overhead in others. 3. Replace deprecated header includes with the more recent alternatives. For example: boost/detail/lightweight_test.hpp -> boost/core/lightweight_test.hpp, boost/ref.hpp -> boost/core/ref.hpp. 4. Replace some blanket includes with the more fine-grained ones. For example, boost/utility.hpp, boost/atomic.hpp. This reduces compile time overhead. 5. Add some missing includes, for example, boost/core/ref.hpp and boost/type_traits/is_same.hpp. 6. Replace uses of std::is_same with boost::is_same (with the corresponding included header) since the standard type_traits header presence and validity is not tested by the code. Using boost::is_same makes the code more portable. --- .../detail/sync_deque_base.hpp | 5 +- .../detail/sync_queue_base.hpp | 5 +- include/boost/thread/detail/thread.hpp | 3 +- include/boost/thread/future.hpp | 10 ++-- include/boost/thread/pthread/once.hpp | 9 ++-- include/boost/thread/pthread/once_atomic.hpp | 6 ++- include/boost/thread/pthread/shared_mutex.hpp | 32 ++++++------ include/boost/thread/v2/shared_mutex.hpp | 52 +++++++++---------- include/boost/thread/win32/once.hpp | 4 +- src/pthread/once_atomic.cpp | 2 +- .../parallel/v1/exception_list_pass.cpp | 2 +- .../parallel/v2/task_region_pass.cpp | 2 +- test/functional/invoke/invoke_int_0_pass.cpp | 2 +- test/functional/invoke/invoke_lvalue_pass.cpp | 2 +- test/functional/invoke/invoke_rvalue_pass.cpp | 2 +- .../functional/invoker/invoker_int_0_pass.cpp | 2 +- .../invoker/invoker_lvalue_pass.cpp | 2 +- .../invoker/invoker_rvalue_pass.cpp | 2 +- .../condition_variable/copy_fail.cpp | 2 +- .../condition_variable/default_pass.cpp | 2 +- .../condition_variable/dtor_pass.cpp | 2 +- .../condition_variable/lost_notif_pass.cpp | 2 +- .../condition_variable/native_handle_pass.cpp | 3 +- .../condition_variable/wait_for_pass.cpp | 2 +- .../condition_variable/wait_for_pred_pass.cpp | 2 +- .../condition_variable/wait_pass.cpp | 2 +- .../condition_variable/wait_until_pass.cpp | 2 +- .../wait_until_pred_pass.cpp | 2 +- .../condition_variable_any/copy_fail.cpp | 2 +- .../condition_variable_any/default_pass.cpp | 2 +- .../condition_variable_any/dtor_pass.cpp | 2 +- .../lost_notif_pass.cpp | 2 +- .../condition_variable_any/wait_for_pass.cpp | 2 +- .../wait_for_pred_pass.cpp | 2 +- .../wait_until_pass.cpp | 2 +- .../wait_until_pred_pass.cpp | 2 +- .../conditions/cv_status/cv_status_pass.cpp | 2 +- .../notify_all_at_thread_exit_pass.cpp | 2 +- .../futures/async/async_executor_pass.cpp | 2 +- test/sync/futures/async/async_pass.cpp | 2 +- .../future/async_deferred_then_pass.cpp | 2 +- test/sync/futures/future/copy_assign_fail.cpp | 2 +- test/sync/futures/future/copy_ctor_fail.cpp | 2 +- test/sync/futures/future/default_pass.cpp | 2 +- test/sync/futures/future/dtor_pass.cpp | 2 +- test/sync/futures/future/get_or_pass.cpp | 2 +- test/sync/futures/future/get_pass.cpp | 2 +- test/sync/futures/future/move_assign_pass.cpp | 2 +- test/sync/futures/future/move_ctor_pass.cpp | 2 +- test/sync/futures/future/share_pass.cpp | 2 +- .../futures/future/then_deferred_pass.cpp | 2 +- .../futures/future/then_executor_pass.cpp | 2 +- test/sync/futures/future/then_pass.cpp | 2 +- test/sync/futures/future/wait_for_pass.cpp | 2 +- test/sync/futures/future/wait_pass.cpp | 2 +- test/sync/futures/future/wait_until_pass.cpp | 2 +- test/sync/futures/make_ready_future_pass.cpp | 2 +- .../futures/packaged_task/alloc_ctor_pass.cpp | 2 +- .../packaged_task/copy_assign_fail.cpp | 2 +- .../futures/packaged_task/copy_ctor_fail.cpp | 2 +- .../packaged_task/default_ctor_pass.cpp | 2 +- test/sync/futures/packaged_task/dtor_pass.cpp | 2 +- .../futures/packaged_task/func_ctor_pass.cpp | 2 +- .../futures/packaged_task/get_future_pass.cpp | 2 +- .../make_ready_at_thread_exit_pass.cpp | 2 +- .../packaged_task/member_swap_pass.cpp | 2 +- .../packaged_task/move_assign_pass.cpp | 2 +- .../futures/packaged_task/move_ctor_pass.cpp | 2 +- .../packaged_task/non_member_swap_pass.cpp | 2 +- .../futures/packaged_task/operator_pass.cpp | 2 +- .../sync/futures/packaged_task/reset_pass.cpp | 2 +- .../sync/futures/packaged_task/types_pass.cpp | 3 +- .../packaged_task/use_allocator_pass.cpp | 2 +- test/sync/futures/promise/alloc_ctor_pass.cpp | 2 +- .../sync/futures/promise/copy_assign_fail.cpp | 2 +- test/sync/futures/promise/copy_ctor_fail.cpp | 2 +- test/sync/futures/promise/default_pass.cpp | 2 +- test/sync/futures/promise/dtor_pass.cpp | 2 +- test/sync/futures/promise/emplace_pass.cpp | 2 +- test/sync/futures/promise/get_future_pass.cpp | 2 +- .../sync/futures/promise/move_assign_pass.cpp | 2 +- test/sync/futures/promise/move_ctor_pass.cpp | 2 +- .../set_exception_at_thread_exit_pass.cpp | 2 +- .../futures/promise/set_exception_pass.cpp | 2 +- .../set_lvalue_at_thread_exit_pass.cpp | 2 +- test/sync/futures/promise/set_lvalue_pass.cpp | 2 +- .../set_rvalue_at_thread_exit_pass.cpp | 2 +- test/sync/futures/promise/set_rvalue_pass.cpp | 2 +- .../set_value_at_thread_exit_const_pass.cpp | 2 +- .../set_value_at_thread_exit_void_pass.cpp | 2 +- .../futures/promise/set_value_const_pass.cpp | 2 +- .../futures/promise/set_value_void_pass.cpp | 2 +- .../futures/promise/use_allocator_pass.cpp | 2 +- .../shared_future/copy_assign_pass.cpp | 2 +- .../futures/shared_future/copy_ctor_pass.cpp | 2 +- .../futures/shared_future/default_pass.cpp | 2 +- test/sync/futures/shared_future/dtor_pass.cpp | 2 +- test/sync/futures/shared_future/get_pass.cpp | 2 +- .../shared_future/move_assign_pass.cpp | 2 +- .../futures/shared_future/move_ctor_pass.cpp | 2 +- .../shared_future/then_executor_pass.cpp | 2 +- test/sync/futures/shared_future/then_pass.cpp | 2 +- .../futures/shared_future/wait_for_pass.cpp | 2 +- test/sync/futures/shared_future/wait_pass.cpp | 2 +- .../futures/shared_future/wait_until_pass.cpp | 2 +- test/sync/futures/when_all/iterators_pass.cpp | 2 +- test/sync/futures/when_all/none_pass.cpp | 2 +- test/sync/futures/when_all/one_pass.cpp | 2 +- test/sync/futures/when_all/variadic_pass.cpp | 2 +- test/sync/futures/when_any/iterators_pass.cpp | 2 +- test/sync/futures/when_any/none_pass.cpp | 2 +- test/sync/futures/when_any/one_pass.cpp | 2 +- test/sync/futures/when_any/variadic_pass.cpp | 2 +- .../deque_views/single_thread_pass.cpp | 2 +- .../locks/lock_guard/adopt_lock_pass.cpp | 2 +- .../locks/lock_guard/copy_assign_fail.cpp | 2 +- .../locks/lock_guard/copy_ctor_fail.cpp | 2 +- .../locks/lock_guard/default_pass.cpp | 2 +- .../lock_guard_adopt_lock_compile_fail.cpp | 2 +- .../lock_guard_adopt_lock_compile_pass.cpp | 2 +- .../lock_guard/lock_guard_compile_fail.cpp | 2 +- .../lock_guard/lock_guard_compile_pass.cpp | 2 +- .../make_lock_guard_adopt_lock_pass.cpp | 2 +- .../locks/lock_guard/make_lock_guard_pass.cpp | 2 +- .../locks/lock_guard/types_pass.cpp | 2 +- .../nested_strict_lock/copy_assign_fail.cpp | 2 +- .../nested_strict_lock/copy_ctor_fail.cpp | 2 +- .../locks/nested_strict_lock/default_pass.cpp | 2 +- .../make_nested_strict_lock_pass.cpp | 2 +- .../nested_strict_lock/owns_lock_pass.cpp | 2 +- .../locks/nested_strict_lock/types_pass.cpp | 2 +- .../locks/reverse_lock/types_pass.cpp | 2 +- .../reverse_lock/unique_lock_ctor_pass.cpp | 2 +- .../shared_lock/cons/adopt_lock_pass.cpp | 2 +- .../shared_lock/cons/copy_assign_fail.cpp | 2 +- .../locks/shared_lock/cons/copy_ctor_fail.cpp | 2 +- .../locks/shared_lock/cons/default_pass.cpp | 2 +- .../shared_lock/cons/defer_lock_pass.cpp | 2 +- .../locks/shared_lock/cons/duration_pass.cpp | 2 +- .../shared_lock/cons/move_assign_pass.cpp | 2 +- .../locks/shared_lock/cons/move_ctor_pass.cpp | 2 +- .../cons/move_ctor_unique_lock_pass.cpp | 2 +- .../cons/move_ctor_upgrade_lock_pass.cpp | 2 +- .../locks/shared_lock/cons/mutex_pass.cpp | 2 +- .../shared_lock/cons/time_point_pass.cpp | 2 +- .../shared_lock/cons/try_to_lock_pass.cpp | 2 +- .../locks/shared_lock/locking/lock_pass.cpp | 2 +- .../shared_lock/locking/try_lock_for_pass.cpp | 2 +- .../shared_lock/locking/try_lock_pass.cpp | 2 +- .../locking/try_lock_until_pass.cpp | 2 +- .../locks/shared_lock/locking/unlock_pass.cpp | 2 +- .../shared_lock/mod/member_swap_pass.cpp | 2 +- .../shared_lock/mod/non_member_swap_pass.cpp | 2 +- .../locks/shared_lock/mod/release_pass.cpp | 2 +- .../locks/shared_lock/obs/mutex_pass.cpp | 2 +- .../locks/shared_lock/obs/op_bool_pass.cpp | 2 +- .../locks/shared_lock/obs/owns_lock_pass.cpp | 2 +- .../locks/shared_lock/types_pass.cpp | 3 +- .../shared_lock_guard/adopt_lock_pass.cpp | 2 +- .../shared_lock_guard/copy_assign_fail.cpp | 2 +- .../shared_lock_guard/copy_ctor_fail.cpp | 2 +- .../locks/shared_lock_guard/default_pass.cpp | 2 +- .../locks/shared_lock_guard/types_pass.cpp | 2 +- .../locks/strict_lock/copy_assign_fail.cpp | 2 +- .../locks/strict_lock/copy_ctor_fail.cpp | 2 +- .../locks/strict_lock/default_pass.cpp | 2 +- .../strict_lock/make_strict_lock_pass.cpp | 2 +- .../locks/strict_lock/owns_lock_pass.cpp | 2 +- .../locks/strict_lock/types_pass.cpp | 2 +- .../unique_lock/cons/adopt_lock_pass.cpp | 2 +- .../unique_lock/cons/copy_assign_fail.cpp | 2 +- .../locks/unique_lock/cons/copy_ctor_fail.cpp | 2 +- .../locks/unique_lock/cons/default_pass.cpp | 2 +- .../unique_lock/cons/defer_lock_pass.cpp | 2 +- .../locks/unique_lock/cons/duration_pass.cpp | 2 +- .../cons/make_unique_lock_adopt_lock_pass.cpp | 2 +- .../cons/make_unique_lock_defer_lock_pass.cpp | 2 +- .../cons/make_unique_lock_mutex_pass.cpp | 2 +- .../make_unique_lock_try_to_lock_pass.cpp | 2 +- .../cons/make_unique_locks_mutex_pass.cpp | 2 +- .../unique_lock/cons/move_assign_pass.cpp | 2 +- .../locks/unique_lock/cons/move_ctor_pass.cpp | 2 +- .../cons/move_ctor_shared_lock_for_pass.cpp | 2 +- .../cons/move_ctor_shared_lock_try_pass.cpp | 2 +- .../cons/move_ctor_shared_lock_until_pass.cpp | 2 +- .../cons/move_ctor_upgrade_lock_for_pass.cpp | 2 +- .../cons/move_ctor_upgrade_lock_pass.cpp | 2 +- .../cons/move_ctor_upgrade_lock_try_pass.cpp | 2 +- .../move_ctor_upgrade_lock_until_pass.cpp | 2 +- .../locks/unique_lock/cons/mutex_pass.cpp | 2 +- .../unique_lock/cons/time_point_pass.cpp | 2 +- .../unique_lock/cons/try_to_lock_pass.cpp | 2 +- .../locks/unique_lock/locking/lock_pass.cpp | 2 +- .../unique_lock/locking/try_lock_for_pass.cpp | 2 +- .../unique_lock/locking/try_lock_pass.cpp | 2 +- .../locking/try_lock_until_pass.cpp | 2 +- .../locks/unique_lock/locking/unlock_pass.cpp | 2 +- .../unique_lock/mod/member_swap_pass.cpp | 2 +- .../unique_lock/mod/non_member_swap_pass.cpp | 2 +- .../locks/unique_lock/mod/release_pass.cpp | 2 +- .../locks/unique_lock/obs/mutex_pass.cpp | 2 +- .../locks/unique_lock/obs/op_bool_pass.cpp | 2 +- .../locks/unique_lock/obs/op_int_fail.cpp | 2 +- .../locks/unique_lock/obs/owns_lock_pass.cpp | 2 +- .../locks/unique_lock/types_pass.cpp | 3 +- .../upgrade_lock/cons/adopt_lock_pass.cpp | 2 +- .../upgrade_lock/cons/copy_assign_fail.cpp | 2 +- .../upgrade_lock/cons/copy_ctor_fail.cpp | 2 +- .../locks/upgrade_lock/cons/default_pass.cpp | 2 +- .../upgrade_lock/cons/defer_lock_pass.cpp | 2 +- .../locks/upgrade_lock/cons/duration_pass.cpp | 2 +- .../upgrade_lock/cons/move_assign_pass.cpp | 2 +- .../upgrade_lock/cons/move_ctor_pass.cpp | 2 +- .../cons/move_ctor_shared_lock_for_pass.cpp | 2 +- .../cons/move_ctor_shared_lock_try_pass.cpp | 2 +- .../cons/move_ctor_shared_lock_until_pass.cpp | 2 +- .../cons/move_ctor_unique_lock_pass.cpp | 2 +- .../locks/upgrade_lock/cons/mutex_pass.cpp | 2 +- .../upgrade_lock/cons/time_point_pass.cpp | 2 +- .../upgrade_lock/cons/try_to_lock_pass.cpp | 2 +- .../locks/upgrade_lock/locking/lock_pass.cpp | 2 +- .../locking/try_lock_for_pass.cpp | 2 +- .../upgrade_lock/locking/try_lock_pass.cpp | 2 +- .../locking/try_lock_until_pass.cpp | 2 +- .../upgrade_lock/locking/unlock_pass.cpp | 2 +- .../upgrade_lock/mod/member_swap_pass.cpp | 2 +- .../upgrade_lock/mod/non_member_swap_pass.cpp | 2 +- .../locks/upgrade_lock/mod/release_pass.cpp | 2 +- .../locks/upgrade_lock/obs/mutex_pass.cpp | 2 +- .../locks/upgrade_lock/obs/op_bool_pass.cpp | 2 +- .../locks/upgrade_lock/obs/owns_lock_pass.cpp | 2 +- .../locks/upgrade_lock/types_pass.cpp | 3 +- .../mutual_exclusion/mutex/assign_fail.cpp | 2 +- .../sync/mutual_exclusion/mutex/copy_fail.cpp | 2 +- .../mutual_exclusion/mutex/default_pass.cpp | 2 +- .../mutex/lock_compile_fail.cpp | 2 +- .../mutex/lock_compile_pass.cpp | 2 +- .../sync/mutual_exclusion/mutex/lock_pass.cpp | 2 +- .../mutex/native_handle_pass.cpp | 2 +- .../mutex/try_lock_compile_fail.cpp | 2 +- .../mutex/try_lock_compile_pass.cpp | 2 +- .../mutual_exclusion/mutex/try_lock_pass.cpp | 2 +- .../null_mutex/assign_fail.cpp | 2 +- .../mutual_exclusion/null_mutex/copy_fail.cpp | 2 +- .../null_mutex/default_pass.cpp | 2 +- .../mutual_exclusion/null_mutex/lock_pass.cpp | 2 +- .../null_mutex/try_lock_for_pass.cpp | 2 +- .../null_mutex/try_lock_pass.cpp | 2 +- .../null_mutex/try_lock_until_pass.cpp | 2 +- .../once/call_once/call_once_pass.cpp | 2 +- .../queue_views/single_thread_pass.cpp | 2 +- .../recursive_mutex/assign_fail.cpp | 2 +- .../recursive_mutex/copy_fail.cpp | 2 +- .../recursive_mutex/default_pass.cpp | 2 +- .../recursive_mutex/lock_pass.cpp | 2 +- .../recursive_mutex/native_handle_pass.cpp | 2 +- .../recursive_mutex/try_lock_pass.cpp | 2 +- .../recursive_timed_mutex/assign_fail.cpp | 2 +- .../recursive_timed_mutex/copy_fail.cpp | 2 +- .../recursive_timed_mutex/default_pass.cpp | 2 +- .../recursive_timed_mutex/lock_pass.cpp | 2 +- .../native_handle_pass.cpp | 2 +- .../try_lock_for_pass.cpp | 2 +- .../recursive_timed_mutex/try_lock_pass.cpp | 2 +- .../try_lock_until_pass.cpp | 2 +- .../shared_mutex/assign_fail.cpp | 2 +- .../shared_mutex/copy_fail.cpp | 2 +- .../shared_mutex/default_pass.cpp | 2 +- .../shared_mutex/lock_pass.cpp | 2 +- .../shared_mutex/try_lock_for_pass.cpp | 2 +- .../shared_mutex/try_lock_pass.cpp | 2 +- .../shared_mutex/try_lock_until_pass.cpp | 2 +- .../sync_bounded_queue/multi_thread_pass.cpp | 2 +- .../sync_bounded_queue/single_thread_pass.cpp | 2 +- .../sync_deque/multi_thread_pass.cpp | 2 +- .../sync_deque/single_thread_pass.cpp | 2 +- .../sync_pq/pq_multi_thread_pass.cpp | 1 + .../sync_pq/pq_single_thread_pass.cpp | 2 +- .../sync_pq/tq_multi_thread_pass.cpp | 1 + .../sync_pq/tq_single_thread_pass.cpp | 1 + .../sync_queue/multi_thread_pass.cpp | 2 +- .../sync_queue/single_thread_pass.cpp | 2 +- .../synchronized_value/call_pass.cpp | 2 +- .../synchronized_value/copy_T_assign_pass.cpp | 2 +- .../synchronized_value/copy_T_ctor_pass.cpp | 2 +- .../synchronized_value/copy_assign_pass.cpp | 2 +- .../synchronized_value/copy_ctor_pass.cpp | 2 +- .../synchronized_value/default_ctor_pass.cpp | 2 +- .../synchronized_value/indirect_pass.cpp | 2 +- .../synchronized_value/move_T_assign_pass.cpp | 2 +- .../synchronized_value/move_T_ctor_pass.cpp | 2 +- .../synchronized_value/move_assign_pass.cpp | 2 +- .../synchronized_value/move_ctor_pass.cpp | 2 +- .../synchronized_value/swap_T_pass.cpp | 2 +- .../synchronized_value/swap_pass.cpp | 2 +- .../synchronized_value/synchronize_pass.cpp | 2 +- .../timed_mutex/assign_fail.cpp | 2 +- .../timed_mutex/copy_fail.cpp | 2 +- .../timed_mutex/default_pass.cpp | 2 +- .../timed_mutex/lock_pass.cpp | 2 +- .../timed_mutex/native_handle_pass.cpp | 2 +- .../timed_mutex/try_lock_for_pass.cpp | 2 +- .../timed_mutex/try_lock_pass.cpp | 2 +- .../timed_mutex/try_lock_until_pass.cpp | 2 +- .../with_lock_guard/with_lock_guard_bind.cpp | 3 +- .../with_lock_guard_lambda.cpp | 2 +- .../with_lock_guard/with_lock_guard_move.cpp | 2 +- .../with_lock_guard_simple.cpp | 2 +- test/test_10963.cpp | 9 ++-- test/test_10964.cpp | 40 +++++++------- test/test_2309.cpp | 2 +- test/test_2741.cpp | 5 -- test/test_3837.cpp | 3 +- test/test_4648.cpp | 1 + test/test_5502.cpp | 3 +- test/test_7328.cpp | 2 +- test/test_8557.cpp | 2 - test/test_8943.cpp | 2 +- test/test_8960.cpp | 6 +-- test/test_9303.cpp | 4 +- test/test_barrier.cpp | 2 +- test/test_barrier_size_fct.cpp | 2 +- test/test_barrier_void_fct.cpp | 2 +- test/test_completion_latch.cpp | 2 +- test/test_latch.cpp | 2 +- test/test_lock_concept.cpp | 1 + test/test_ml.cpp | 3 +- test/test_mutex.cpp | 2 + test/test_scheduler.cpp | 1 + test/test_scheduling_adaptor.cpp | 1 + test/test_thread.cpp | 4 +- test/test_thread_launching.cpp | 4 +- test/test_thread_mf.cpp | 2 +- test/test_time_jumps.cpp | 25 ++++----- .../container/thread_ptr_list_pass.cpp | 4 +- test/threads/container/thread_vector_pass.cpp | 2 +- .../this_thread/get_id/get_id_pass.cpp | 2 +- .../this_thread/sleep_for/sleep_for_pass.cpp | 2 +- .../sleep_until/sleep_until_pass.cpp | 2 +- test/threads/thread/assign/copy_fail.cpp | 2 +- test/threads/thread/assign/move_pass.cpp | 2 +- test/threads/thread/constr/FArgs_pass.cpp | 2 +- test/threads/thread/constr/F_pass.cpp | 2 +- .../thread/constr/FrvalueArgs_pass.cpp | 2 +- test/threads/thread/constr/Frvalue_pass.cpp | 2 +- test/threads/thread/constr/copy_fail.cpp | 2 +- test/threads/thread/constr/default_pass.cpp | 2 +- test/threads/thread/constr/lambda_pass.cpp | 2 +- test/threads/thread/constr/move_pass.cpp | 2 +- test/threads/thread/destr/dtor_pass.cpp | 2 +- test/threads/thread/id/hash_pass.cpp | 2 +- test/threads/thread/members/detach_pass.cpp | 2 +- test/threads/thread/members/get_id_pass.cpp | 2 +- test/threads/thread/members/join_pass.cpp | 2 +- test/threads/thread/members/joinable_pass.cpp | 2 +- .../thread/members/native_handle_pass.cpp | 2 +- test/threads/thread/members/swap_pass.cpp | 2 +- .../thread/members/try_join_for_pass.cpp | 2 +- .../thread/members/try_join_until_pass.cpp | 2 +- test/threads/thread/non_members/swap_pass.cpp | 2 +- .../static/hardware_concurrency_pass.cpp | 2 +- test/timming.hpp | 2 +- 362 files changed, 472 insertions(+), 445 deletions(-) diff --git a/include/boost/thread/concurrent_queues/detail/sync_deque_base.hpp b/include/boost/thread/concurrent_queues/detail/sync_deque_base.hpp index 0897681928..bcabaa38a0 100644 --- a/include/boost/thread/concurrent_queues/detail/sync_deque_base.hpp +++ b/include/boost/thread/concurrent_queues/detail/sync_deque_base.hpp @@ -12,6 +12,7 @@ ////////////////////////////////////////////////////////////////////////////// #include +#include #include #include @@ -187,7 +188,7 @@ namespace detail template bool sync_deque_base::wait_until_not_empty_or_closed(unique_lock& lk) { - cond_.wait(lk, boost::bind(&sync_deque_base::not_empty_or_closed, boost::ref(*this), boost::ref(lk))); + cond_.wait(lk, boost::bind(&sync_deque_base::not_empty_or_closed, this, boost::ref(lk))); if (! empty(lk)) return false; // success return true; // closed } @@ -196,7 +197,7 @@ namespace detail template queue_op_status sync_deque_base::wait_until_not_empty_or_closed_until(unique_lock& lk, chrono::time_point const&tp) { - if (! cond_.wait_until(lk, tp, boost::bind(&sync_deque_base::not_empty_or_closed, boost::ref(*this), boost::ref(lk)))) + if (! cond_.wait_until(lk, tp, boost::bind(&sync_deque_base::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; diff --git a/include/boost/thread/concurrent_queues/detail/sync_queue_base.hpp b/include/boost/thread/concurrent_queues/detail/sync_queue_base.hpp index 2b3d27b728..71379e7129 100644 --- a/include/boost/thread/concurrent_queues/detail/sync_queue_base.hpp +++ b/include/boost/thread/concurrent_queues/detail/sync_queue_base.hpp @@ -12,6 +12,7 @@ ////////////////////////////////////////////////////////////////////////////// #include +#include #include #include @@ -187,7 +188,7 @@ namespace detail template bool sync_queue_base::wait_until_not_empty_or_closed(unique_lock& lk) { - cond_.wait(lk, boost::bind(&sync_queue_base::not_empty_or_closed, boost::ref(*this), boost::ref(lk))); + cond_.wait(lk, boost::bind(&sync_queue_base::not_empty_or_closed, this, boost::ref(lk))); if (! empty(lk)) return false; // success return true; // closed } @@ -196,7 +197,7 @@ namespace detail template queue_op_status sync_queue_base::wait_until_not_empty_or_closed_until(unique_lock& lk, chrono::time_point const&tp) { - if (! cond_.wait_until(lk, tp, boost::bind(&sync_queue_base::not_empty_or_closed, boost::ref(*this), boost::ref(lk)))) + if (! cond_.wait_until(lk, tp, boost::bind(&sync_queue_base::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; diff --git a/include/boost/thread/detail/thread.hpp b/include/boost/thread/detail/thread.hpp index 6618bbd0dc..57c637f34e 100644 --- a/include/boost/thread/detail/thread.hpp +++ b/include/boost/thread/detail/thread.hpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -47,6 +46,8 @@ #if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) #include +#else +#include #endif #include diff --git a/include/boost/thread/future.hpp b/include/boost/thread/future.hpp index bbf0ffc809..ea1c97ba93 100644 --- a/include/boost/thread/future.hpp +++ b/include/boost/thread/future.hpp @@ -393,7 +393,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); @@ -420,7 +420,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) @@ -430,7 +430,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 @@ -443,7 +443,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; } @@ -940,7 +940,7 @@ namespace boost join(); #elif defined BOOST_THREAD_ASYNC_FUTURE_WAITS unique_lock 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 } diff --git a/include/boost/thread/pthread/once.hpp b/include/boost/thread/pthread/once.hpp index 7d66435263..d9eb52eda0 100644 --- a/include/boost/thread/pthread/once.hpp +++ b/include/boost/thread/pthread/once.hpp @@ -19,14 +19,17 @@ #include #include -#include #include -#include - #include #include #include +#if !defined(BOOST_THREAD_PROVIDES_INVOKE) && !defined(BOOST_THREAD_PROVIDES_INVOKE_RET) +#include +#endif + +#include + namespace boost { diff --git a/include/boost/thread/pthread/once_atomic.hpp b/include/boost/thread/pthread/once_atomic.hpp index ce96702ffb..a35c5efd9f 100644 --- a/include/boost/thread/pthread/once_atomic.hpp +++ b/include/boost/thread/pthread/once_atomic.hpp @@ -16,8 +16,12 @@ #include #include #include +#include +#include + +#if !defined(BOOST_THREAD_PROVIDES_INVOKE) && !defined(BOOST_THREAD_PROVIDES_INVOKE_RET) #include -#include +#endif #include diff --git a/include/boost/thread/pthread/shared_mutex.hpp b/include/boost/thread/pthread/shared_mutex.hpp index 993e6f2602..d4b828045d 100644 --- a/include/boost/thread/pthread/shared_mutex.hpp +++ b/include/boost/thread/pthread/shared_mutex.hpp @@ -171,7 +171,7 @@ namespace boost boost::this_thread::disable_interruption do_not_disturb; #endif boost::unique_lock 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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; } diff --git a/include/boost/thread/v2/shared_mutex.hpp b/include/boost/thread/v2/shared_mutex.hpp index 8b0cf8ee1f..70ba47daf1 100644 --- a/include/boost/thread/v2/shared_mutex.hpp +++ b/include/boost/thread/v2/shared_mutex.hpp @@ -275,9 +275,9 @@ namespace boost { inline void shared_mutex::lock() { boost::unique_lock 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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_); diff --git a/include/boost/thread/win32/once.hpp b/include/boost/thread/win32/once.hpp index 5625dbc1bf..f5850bdebb 100644 --- a/include/boost/thread/win32/once.hpp +++ b/include/boost/thread/win32/once.hpp @@ -22,7 +22,9 @@ #include #include +#if !defined(BOOST_THREAD_PROVIDES_INVOKE) && !defined(BOOST_THREAD_PROVIDES_INVOKE_RET) #include +#endif #include @@ -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, diff --git a/src/pthread/once_atomic.cpp b/src/pthread/once_atomic.cpp index 69f5be8098..5f480a4c66 100644 --- a/src/pthread/once_atomic.cpp +++ b/src/pthread/once_atomic.cpp @@ -11,8 +11,8 @@ #include #include #include -#include #include +#include #include namespace boost diff --git a/test/experimental/parallel/v1/exception_list_pass.cpp b/test/experimental/parallel/v1/exception_list_pass.cpp index de79412ae5..cc1a45f15f 100644 --- a/test/experimental/parallel/v1/exception_list_pass.cpp +++ b/test/experimental/parallel/v1/exception_list_pass.cpp @@ -14,7 +14,7 @@ #include -#include +#include int main() diff --git a/test/experimental/parallel/v2/task_region_pass.cpp b/test/experimental/parallel/v2/task_region_pass.cpp index 814ef28e5b..1ee8437f7f 100644 --- a/test/experimental/parallel/v2/task_region_pass.cpp +++ b/test/experimental/parallel/v2/task_region_pass.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #if ! defined BOOST_NO_CXX11_LAMBDAS && defined(BOOST_THREAD_PROVIDES_INVOKE) using boost::experimental::parallel::v2::task_region; diff --git a/test/functional/invoke/invoke_int_0_pass.cpp b/test/functional/invoke/invoke_int_0_pass.cpp index fa1f675439..afadb60cda 100644 --- a/test/functional/invoke/invoke_int_0_pass.cpp +++ b/test/functional/invoke/invoke_int_0_pass.cpp @@ -15,7 +15,7 @@ // #include -#include +#include int f() { diff --git a/test/functional/invoke/invoke_lvalue_pass.cpp b/test/functional/invoke/invoke_lvalue_pass.cpp index 154953d891..ee1adb0554 100644 --- a/test/functional/invoke/invoke_lvalue_pass.cpp +++ b/test/functional/invoke/invoke_lvalue_pass.cpp @@ -16,7 +16,7 @@ // #include -#include +#include int count = 0; diff --git a/test/functional/invoke/invoke_rvalue_pass.cpp b/test/functional/invoke/invoke_rvalue_pass.cpp index 82ea094326..85d5d89b96 100644 --- a/test/functional/invoke/invoke_rvalue_pass.cpp +++ b/test/functional/invoke/invoke_rvalue_pass.cpp @@ -15,7 +15,7 @@ // #include -#include +#include int count = 0; diff --git a/test/functional/invoker/invoker_int_0_pass.cpp b/test/functional/invoker/invoker_int_0_pass.cpp index 123bde2e6a..f0194078c4 100644 --- a/test/functional/invoker/invoker_int_0_pass.cpp +++ b/test/functional/invoker/invoker_int_0_pass.cpp @@ -15,7 +15,7 @@ // #include -#include +#include int f() { diff --git a/test/functional/invoker/invoker_lvalue_pass.cpp b/test/functional/invoker/invoker_lvalue_pass.cpp index 42a98d45a1..d1a6acaad0 100644 --- a/test/functional/invoker/invoker_lvalue_pass.cpp +++ b/test/functional/invoker/invoker_lvalue_pass.cpp @@ -15,7 +15,7 @@ // #include -#include +#include int count = 0; diff --git a/test/functional/invoker/invoker_rvalue_pass.cpp b/test/functional/invoker/invoker_rvalue_pass.cpp index ae06e16b62..55139efd48 100644 --- a/test/functional/invoker/invoker_rvalue_pass.cpp +++ b/test/functional/invoker/invoker_rvalue_pass.cpp @@ -19,7 +19,7 @@ #endif #include -#include +#include int count = 0; diff --git a/test/sync/conditions/condition_variable/copy_fail.cpp b/test/sync/conditions/condition_variable/copy_fail.cpp index 374ce31652..58dd5b9794 100644 --- a/test/sync/conditions/condition_variable/copy_fail.cpp +++ b/test/sync/conditions/condition_variable/copy_fail.cpp @@ -18,7 +18,7 @@ // condition_variable(const condition_variable&) = delete; #include -#include +#include void fail() { diff --git a/test/sync/conditions/condition_variable/default_pass.cpp b/test/sync/conditions/condition_variable/default_pass.cpp index 465a12de86..4842355daa 100644 --- a/test/sync/conditions/condition_variable/default_pass.cpp +++ b/test/sync/conditions/condition_variable/default_pass.cpp @@ -18,7 +18,7 @@ // condition_variable(const condition_variable&) = delete; #include -#include +#include int main() { diff --git a/test/sync/conditions/condition_variable/dtor_pass.cpp b/test/sync/conditions/condition_variable/dtor_pass.cpp index 533898ed46..34b4a1cc7c 100644 --- a/test/sync/conditions/condition_variable/dtor_pass.cpp +++ b/test/sync/conditions/condition_variable/dtor_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include boost::condition_variable* cv; boost::mutex m; diff --git a/test/sync/conditions/condition_variable/lost_notif_pass.cpp b/test/sync/conditions/condition_variable/lost_notif_pass.cpp index 79dbcd2956..a79a7dce26 100644 --- a/test/sync/conditions/condition_variable/lost_notif_pass.cpp +++ b/test/sync/conditions/condition_variable/lost_notif_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include // Summary of each test: diff --git a/test/sync/conditions/condition_variable/native_handle_pass.cpp b/test/sync/conditions/condition_variable/native_handle_pass.cpp index 9835f5920f..51a4130d87 100644 --- a/test/sync/conditions/condition_variable/native_handle_pass.cpp +++ b/test/sync/conditions/condition_variable/native_handle_pass.cpp @@ -20,7 +20,8 @@ #include #include -#include +#include +#include int main() { diff --git a/test/sync/conditions/condition_variable/wait_for_pass.cpp b/test/sync/conditions/condition_variable/wait_for_pass.cpp index 4c6a0af3ec..d6dd519a74 100644 --- a/test/sync/conditions/condition_variable/wait_for_pass.cpp +++ b/test/sync/conditions/condition_variable/wait_for_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include "../../../timming.hpp" diff --git a/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp b/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp index 92ba82f1ed..8b03f35cf5 100644 --- a/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp +++ b/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include "../../../timming.hpp" diff --git a/test/sync/conditions/condition_variable/wait_pass.cpp b/test/sync/conditions/condition_variable/wait_pass.cpp index 612724b857..1438ee4ae6 100644 --- a/test/sync/conditions/condition_variable/wait_pass.cpp +++ b/test/sync/conditions/condition_variable/wait_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/test/sync/conditions/condition_variable/wait_until_pass.cpp b/test/sync/conditions/condition_variable/wait_until_pass.cpp index 34ef322684..cafd66b22e 100644 --- a/test/sync/conditions/condition_variable/wait_until_pass.cpp +++ b/test/sync/conditions/condition_variable/wait_until_pass.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include "../../../timming.hpp" diff --git a/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp b/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp index 120e49853f..f4441ea4bd 100644 --- a/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp +++ b/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include "../../../timming.hpp" diff --git a/test/sync/conditions/condition_variable_any/copy_fail.cpp b/test/sync/conditions/condition_variable_any/copy_fail.cpp index 71d3a3f06e..2b21d7013e 100644 --- a/test/sync/conditions/condition_variable_any/copy_fail.cpp +++ b/test/sync/conditions/condition_variable_any/copy_fail.cpp @@ -18,7 +18,7 @@ // condition_variable_any(const condition_variable_any&) = delete; #include -#include +#include void fail() { diff --git a/test/sync/conditions/condition_variable_any/default_pass.cpp b/test/sync/conditions/condition_variable_any/default_pass.cpp index 21116ebc48..fdbc6dc8ed 100644 --- a/test/sync/conditions/condition_variable_any/default_pass.cpp +++ b/test/sync/conditions/condition_variable_any/default_pass.cpp @@ -18,7 +18,7 @@ // condition_variable_any(const condition_variable_any&) = delete; #include -#include +#include int main() { diff --git a/test/sync/conditions/condition_variable_any/dtor_pass.cpp b/test/sync/conditions/condition_variable_any/dtor_pass.cpp index 7734d93b74..15930311ed 100644 --- a/test/sync/conditions/condition_variable_any/dtor_pass.cpp +++ b/test/sync/conditions/condition_variable_any/dtor_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include boost::condition_variable_any* cv; boost::timed_mutex m; diff --git a/test/sync/conditions/condition_variable_any/lost_notif_pass.cpp b/test/sync/conditions/condition_variable_any/lost_notif_pass.cpp index c696da3c24..08cb176027 100644 --- a/test/sync/conditions/condition_variable_any/lost_notif_pass.cpp +++ b/test/sync/conditions/condition_variable_any/lost_notif_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include // Summary of each test: diff --git a/test/sync/conditions/condition_variable_any/wait_for_pass.cpp b/test/sync/conditions/condition_variable_any/wait_for_pass.cpp index b1fca89f68..365badb477 100644 --- a/test/sync/conditions/condition_variable_any/wait_for_pass.cpp +++ b/test/sync/conditions/condition_variable_any/wait_for_pass.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/conditions/condition_variable_any/wait_for_pred_pass.cpp b/test/sync/conditions/condition_variable_any/wait_for_pred_pass.cpp index 3885b23c12..9fd43a2f80 100644 --- a/test/sync/conditions/condition_variable_any/wait_for_pred_pass.cpp +++ b/test/sync/conditions/condition_variable_any/wait_for_pred_pass.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/conditions/condition_variable_any/wait_until_pass.cpp b/test/sync/conditions/condition_variable_any/wait_until_pass.cpp index acf5fb1c42..a65d7af669 100644 --- a/test/sync/conditions/condition_variable_any/wait_until_pass.cpp +++ b/test/sync/conditions/condition_variable_any/wait_until_pass.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/conditions/condition_variable_any/wait_until_pred_pass.cpp b/test/sync/conditions/condition_variable_any/wait_until_pred_pass.cpp index f6e9b7ee24..55dffa7945 100644 --- a/test/sync/conditions/condition_variable_any/wait_until_pred_pass.cpp +++ b/test/sync/conditions/condition_variable_any/wait_until_pred_pass.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/conditions/cv_status/cv_status_pass.cpp b/test/sync/conditions/cv_status/cv_status_pass.cpp index becac4da5e..8413da6215 100644 --- a/test/sync/conditions/cv_status/cv_status_pass.cpp +++ b/test/sync/conditions/cv_status/cv_status_pass.cpp @@ -18,7 +18,7 @@ // static unsigned hardware_concurrency(); #include -#include +#include int main() { diff --git a/test/sync/conditions/notify_all_at_thread_exit_pass.cpp b/test/sync/conditions/notify_all_at_thread_exit_pass.cpp index d6eecbd95b..a99c093d26 100644 --- a/test/sync/conditions/notify_all_at_thread_exit_pass.cpp +++ b/test/sync/conditions/notify_all_at_thread_exit_pass.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include boost::condition_variable cv; boost::mutex mut; diff --git a/test/sync/futures/async/async_executor_pass.cpp b/test/sync/futures/async/async_executor_pass.cpp index d5a0f4423c..7e2e3ae5fd 100644 --- a/test/sync/futures/async/async_executor_pass.cpp +++ b/test/sync/futures/async/async_executor_pass.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/test/sync/futures/async/async_pass.cpp b/test/sync/futures/async/async_pass.cpp index 86fdfdbec6..d5e5daff40 100644 --- a/test/sync/futures/async/async_pass.cpp +++ b/test/sync/futures/async/async_pass.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include typedef boost::chrono::high_resolution_clock Clock; typedef boost::chrono::milliseconds ms; diff --git a/test/sync/futures/future/async_deferred_then_pass.cpp b/test/sync/futures/future/async_deferred_then_pass.cpp index b400074cdd..7749b3a6a2 100644 --- a/test/sync/futures/future/async_deferred_then_pass.cpp +++ b/test/sync/futures/future/async_deferred_then_pass.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) diff --git a/test/sync/futures/future/copy_assign_fail.cpp b/test/sync/futures/future/copy_assign_fail.cpp index 170f3a0575..90d537fe87 100644 --- a/test/sync/futures/future/copy_assign_fail.cpp +++ b/test/sync/futures/future/copy_assign_fail.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include int main() { diff --git a/test/sync/futures/future/copy_ctor_fail.cpp b/test/sync/futures/future/copy_ctor_fail.cpp index 3a16afd500..8c7d2c2b17 100644 --- a/test/sync/futures/future/copy_ctor_fail.cpp +++ b/test/sync/futures/future/copy_ctor_fail.cpp @@ -20,7 +20,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include int main() { diff --git a/test/sync/futures/future/default_pass.cpp b/test/sync/futures/future/default_pass.cpp index 1b4cf392f6..d33e289ec5 100644 --- a/test/sync/futures/future/default_pass.cpp +++ b/test/sync/futures/future/default_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include int main() { diff --git a/test/sync/futures/future/dtor_pass.cpp b/test/sync/futures/future/dtor_pass.cpp index abfca7d8c6..3e2c86551e 100644 --- a/test/sync/futures/future/dtor_pass.cpp +++ b/test/sync/futures/future/dtor_pass.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS #include "../test_allocator.hpp" #endif diff --git a/test/sync/futures/future/get_or_pass.cpp b/test/sync/futures/future/get_or_pass.cpp index 7db938d37e..2d18f80cb4 100644 --- a/test/sync/futures/future/get_or_pass.cpp +++ b/test/sync/futures/future/get_or_pass.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/futures/future/get_pass.cpp b/test/sync/futures/future/get_pass.cpp index ec2ccf8b0a..da50778800 100644 --- a/test/sync/futures/future/get_pass.cpp +++ b/test/sync/futures/future/get_pass.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/futures/future/move_assign_pass.cpp b/test/sync/futures/future/move_assign_pass.cpp index ebb13e5e0f..19007111a6 100644 --- a/test/sync/futures/future/move_assign_pass.cpp +++ b/test/sync/futures/future/move_assign_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include boost::mutex m0; boost::mutex m1; diff --git a/test/sync/futures/future/move_ctor_pass.cpp b/test/sync/futures/future/move_ctor_pass.cpp index 8da893a3c5..701407d22a 100644 --- a/test/sync/futures/future/move_ctor_pass.cpp +++ b/test/sync/futures/future/move_ctor_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include boost::mutex m; diff --git a/test/sync/futures/future/share_pass.cpp b/test/sync/futures/future/share_pass.cpp index 91c07f5cd1..07176efed4 100644 --- a/test/sync/futures/future/share_pass.cpp +++ b/test/sync/futures/future/share_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include int main() { diff --git a/test/sync/futures/future/then_deferred_pass.cpp b/test/sync/futures/future/then_deferred_pass.cpp index 0ea37bd7fa..2ef9cd29de 100644 --- a/test/sync/futures/future/then_deferred_pass.cpp +++ b/test/sync/futures/future/then_deferred_pass.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION diff --git a/test/sync/futures/future/then_executor_pass.cpp b/test/sync/futures/future/then_executor_pass.cpp index fcb062a0e8..11aae4d891 100644 --- a/test/sync/futures/future/then_executor_pass.cpp +++ b/test/sync/futures/future/then_executor_pass.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION diff --git a/test/sync/futures/future/then_pass.cpp b/test/sync/futures/future/then_pass.cpp index 12270679ba..1ce7ae57c2 100644 --- a/test/sync/futures/future/then_pass.cpp +++ b/test/sync/futures/future/then_pass.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION diff --git a/test/sync/futures/future/wait_for_pass.cpp b/test/sync/futures/future/wait_for_pass.cpp index 71bca7abee..9a63636337 100644 --- a/test/sync/futures/future/wait_for_pass.cpp +++ b/test/sync/futures/future/wait_for_pass.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/futures/future/wait_pass.cpp b/test/sync/futures/future/wait_pass.cpp index daa9b376f4..12022f1200 100644 --- a/test/sync/futures/future/wait_pass.cpp +++ b/test/sync/futures/future/wait_pass.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/futures/future/wait_until_pass.cpp b/test/sync/futures/future/wait_until_pass.cpp index e9351671db..8e89805d7e 100644 --- a/test/sync/futures/future/wait_until_pass.cpp +++ b/test/sync/futures/future/wait_until_pass.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/futures/make_ready_future_pass.cpp b/test/sync/futures/make_ready_future_pass.cpp index dfce3cde74..c006e65489 100644 --- a/test/sync/futures/make_ready_future_pass.cpp +++ b/test/sync/futures/make_ready_future_pass.cpp @@ -29,7 +29,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include #include struct A diff --git a/test/sync/futures/packaged_task/alloc_ctor_pass.cpp b/test/sync/futures/packaged_task/alloc_ctor_pass.cpp index e83c064463..4164780c24 100644 --- a/test/sync/futures/packaged_task/alloc_ctor_pass.cpp +++ b/test/sync/futures/packaged_task/alloc_ctor_pass.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS diff --git a/test/sync/futures/packaged_task/copy_assign_fail.cpp b/test/sync/futures/packaged_task/copy_assign_fail.cpp index 7f068eced1..ad6088ccf0 100644 --- a/test/sync/futures/packaged_task/copy_assign_fail.cpp +++ b/test/sync/futures/packaged_task/copy_assign_fail.cpp @@ -26,7 +26,7 @@ #endif #include -#include +#include class A { diff --git a/test/sync/futures/packaged_task/copy_ctor_fail.cpp b/test/sync/futures/packaged_task/copy_ctor_fail.cpp index 22a174961a..a69ee4b353 100644 --- a/test/sync/futures/packaged_task/copy_ctor_fail.cpp +++ b/test/sync/futures/packaged_task/copy_ctor_fail.cpp @@ -26,7 +26,7 @@ #endif #include -#include +#include class A { diff --git a/test/sync/futures/packaged_task/default_ctor_pass.cpp b/test/sync/futures/packaged_task/default_ctor_pass.cpp index 7ab9f1e7c3..9012982e3d 100644 --- a/test/sync/futures/packaged_task/default_ctor_pass.cpp +++ b/test/sync/futures/packaged_task/default_ctor_pass.cpp @@ -26,7 +26,7 @@ #endif #include -#include +#include #include int main() diff --git a/test/sync/futures/packaged_task/dtor_pass.cpp b/test/sync/futures/packaged_task/dtor_pass.cpp index 89620ad058..ca00c22782 100644 --- a/test/sync/futures/packaged_task/dtor_pass.cpp +++ b/test/sync/futures/packaged_task/dtor_pass.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #if BOOST_THREAD_VERSION == 4 #define BOOST_THREAD_DETAIL_SIGNATURE double() diff --git a/test/sync/futures/packaged_task/func_ctor_pass.cpp b/test/sync/futures/packaged_task/func_ctor_pass.cpp index a4bd3105f6..bcd612c063 100644 --- a/test/sync/futures/packaged_task/func_ctor_pass.cpp +++ b/test/sync/futures/packaged_task/func_ctor_pass.cpp @@ -22,7 +22,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include #if BOOST_THREAD_VERSION == 4 #define BOOST_THREAD_DETAIL_SIGNATURE double() diff --git a/test/sync/futures/packaged_task/get_future_pass.cpp b/test/sync/futures/packaged_task/get_future_pass.cpp index 7b29857945..c1bcae94b6 100644 --- a/test/sync/futures/packaged_task/get_future_pass.cpp +++ b/test/sync/futures/packaged_task/get_future_pass.cpp @@ -27,7 +27,7 @@ #endif #include -#include +#include class A { diff --git a/test/sync/futures/packaged_task/make_ready_at_thread_exit_pass.cpp b/test/sync/futures/packaged_task/make_ready_at_thread_exit_pass.cpp index 08db7bbf24..a82005cd2b 100644 --- a/test/sync/futures/packaged_task/make_ready_at_thread_exit_pass.cpp +++ b/test/sync/futures/packaged_task/make_ready_at_thread_exit_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO && \ defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && \ diff --git a/test/sync/futures/packaged_task/member_swap_pass.cpp b/test/sync/futures/packaged_task/member_swap_pass.cpp index fe3c062f85..618c832f17 100644 --- a/test/sync/futures/packaged_task/member_swap_pass.cpp +++ b/test/sync/futures/packaged_task/member_swap_pass.cpp @@ -26,7 +26,7 @@ #endif #include -#include +#include class A { diff --git a/test/sync/futures/packaged_task/move_assign_pass.cpp b/test/sync/futures/packaged_task/move_assign_pass.cpp index fe696c8fb4..9dc8021d32 100644 --- a/test/sync/futures/packaged_task/move_assign_pass.cpp +++ b/test/sync/futures/packaged_task/move_assign_pass.cpp @@ -26,7 +26,7 @@ #endif #include -#include +#include class A { diff --git a/test/sync/futures/packaged_task/move_ctor_pass.cpp b/test/sync/futures/packaged_task/move_ctor_pass.cpp index a5085b3110..2c7e9c6605 100644 --- a/test/sync/futures/packaged_task/move_ctor_pass.cpp +++ b/test/sync/futures/packaged_task/move_ctor_pass.cpp @@ -26,7 +26,7 @@ #endif #include -#include +#include class A { diff --git a/test/sync/futures/packaged_task/non_member_swap_pass.cpp b/test/sync/futures/packaged_task/non_member_swap_pass.cpp index fb579094da..5f4511b694 100644 --- a/test/sync/futures/packaged_task/non_member_swap_pass.cpp +++ b/test/sync/futures/packaged_task/non_member_swap_pass.cpp @@ -26,7 +26,7 @@ #endif #include -#include +#include class A { diff --git a/test/sync/futures/packaged_task/operator_pass.cpp b/test/sync/futures/packaged_task/operator_pass.cpp index db932f72b9..4b067d3666 100644 --- a/test/sync/futures/packaged_task/operator_pass.cpp +++ b/test/sync/futures/packaged_task/operator_pass.cpp @@ -22,7 +22,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/futures/packaged_task/reset_pass.cpp b/test/sync/futures/packaged_task/reset_pass.cpp index 711e7a57fb..4e8cb40450 100644 --- a/test/sync/futures/packaged_task/reset_pass.cpp +++ b/test/sync/futures/packaged_task/reset_pass.cpp @@ -26,7 +26,7 @@ #endif #include -#include +#include class A { diff --git a/test/sync/futures/packaged_task/types_pass.cpp b/test/sync/futures/packaged_task/types_pass.cpp index a52fb04398..6d677acece 100644 --- a/test/sync/futures/packaged_task/types_pass.cpp +++ b/test/sync/futures/packaged_task/types_pass.cpp @@ -23,7 +23,8 @@ #include #include -#include +#include +#include struct A {}; diff --git a/test/sync/futures/packaged_task/use_allocator_pass.cpp b/test/sync/futures/packaged_task/use_allocator_pass.cpp index ef75b7caaf..3f65eef2a9 100644 --- a/test/sync/futures/packaged_task/use_allocator_pass.cpp +++ b/test/sync/futures/packaged_task/use_allocator_pass.cpp @@ -29,7 +29,7 @@ #endif #include -#include +#include #include #if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS diff --git a/test/sync/futures/promise/alloc_ctor_pass.cpp b/test/sync/futures/promise/alloc_ctor_pass.cpp index 0d0c3c0b9e..7c018b34c9 100644 --- a/test/sync/futures/promise/alloc_ctor_pass.cpp +++ b/test/sync/futures/promise/alloc_ctor_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include #if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS #include "../test_allocator.hpp" diff --git a/test/sync/futures/promise/copy_assign_fail.cpp b/test/sync/futures/promise/copy_assign_fail.cpp index 07895578f3..59c505c039 100644 --- a/test/sync/futures/promise/copy_assign_fail.cpp +++ b/test/sync/futures/promise/copy_assign_fail.cpp @@ -18,7 +18,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include int main() { diff --git a/test/sync/futures/promise/copy_ctor_fail.cpp b/test/sync/futures/promise/copy_ctor_fail.cpp index cfd67a6d70..6a1a380289 100644 --- a/test/sync/futures/promise/copy_ctor_fail.cpp +++ b/test/sync/futures/promise/copy_ctor_fail.cpp @@ -18,7 +18,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include int main() { diff --git a/test/sync/futures/promise/default_pass.cpp b/test/sync/futures/promise/default_pass.cpp index 00198a1687..e9ab069cc8 100644 --- a/test/sync/futures/promise/default_pass.cpp +++ b/test/sync/futures/promise/default_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include int main() { diff --git a/test/sync/futures/promise/dtor_pass.cpp b/test/sync/futures/promise/dtor_pass.cpp index e449c03787..09877e4e39 100644 --- a/test/sync/futures/promise/dtor_pass.cpp +++ b/test/sync/futures/promise/dtor_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include int main() { diff --git a/test/sync/futures/promise/emplace_pass.cpp b/test/sync/futures/promise/emplace_pass.cpp index 6a1a352925..af2ffc7059 100644 --- a/test/sync/futures/promise/emplace_pass.cpp +++ b/test/sync/futures/promise/emplace_pass.cpp @@ -22,7 +22,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include #include struct A diff --git a/test/sync/futures/promise/get_future_pass.cpp b/test/sync/futures/promise/get_future_pass.cpp index 13a63b13dc..4b9ae8fc6a 100644 --- a/test/sync/futures/promise/get_future_pass.cpp +++ b/test/sync/futures/promise/get_future_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include int main() { diff --git a/test/sync/futures/promise/move_assign_pass.cpp b/test/sync/futures/promise/move_assign_pass.cpp index 0190527c05..0fbee02bbe 100644 --- a/test/sync/futures/promise/move_assign_pass.cpp +++ b/test/sync/futures/promise/move_assign_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include #if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS #include "../test_allocator.hpp" #endif diff --git a/test/sync/futures/promise/move_ctor_pass.cpp b/test/sync/futures/promise/move_ctor_pass.cpp index a72eb18295..eaac0ddfef 100644 --- a/test/sync/futures/promise/move_ctor_pass.cpp +++ b/test/sync/futures/promise/move_ctor_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include #if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS #include "../test_allocator.hpp" #endif diff --git a/test/sync/futures/promise/set_exception_at_thread_exit_pass.cpp b/test/sync/futures/promise/set_exception_at_thread_exit_pass.cpp index d23d0befb0..44eb118238 100644 --- a/test/sync/futures/promise/set_exception_at_thread_exit_pass.cpp +++ b/test/sync/futures/promise/set_exception_at_thread_exit_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include #include namespace boost diff --git a/test/sync/futures/promise/set_exception_pass.cpp b/test/sync/futures/promise/set_exception_pass.cpp index c27aec2938..679a248486 100644 --- a/test/sync/futures/promise/set_exception_pass.cpp +++ b/test/sync/futures/promise/set_exception_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include #include namespace boost diff --git a/test/sync/futures/promise/set_lvalue_at_thread_exit_pass.cpp b/test/sync/futures/promise/set_lvalue_at_thread_exit_pass.cpp index a143dc636f..ddae1ef316 100644 --- a/test/sync/futures/promise/set_lvalue_at_thread_exit_pass.cpp +++ b/test/sync/futures/promise/set_lvalue_at_thread_exit_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include #include int i = 0; diff --git a/test/sync/futures/promise/set_lvalue_pass.cpp b/test/sync/futures/promise/set_lvalue_pass.cpp index 6acfb62d14..656020e58f 100644 --- a/test/sync/futures/promise/set_lvalue_pass.cpp +++ b/test/sync/futures/promise/set_lvalue_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include #include int main() diff --git a/test/sync/futures/promise/set_rvalue_at_thread_exit_pass.cpp b/test/sync/futures/promise/set_rvalue_at_thread_exit_pass.cpp index 0b23b48347..e11546bcf6 100644 --- a/test/sync/futures/promise/set_rvalue_at_thread_exit_pass.cpp +++ b/test/sync/futures/promise/set_rvalue_at_thread_exit_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include #include #include diff --git a/test/sync/futures/promise/set_rvalue_pass.cpp b/test/sync/futures/promise/set_rvalue_pass.cpp index 63260d7268..234e482caf 100644 --- a/test/sync/futures/promise/set_rvalue_pass.cpp +++ b/test/sync/futures/promise/set_rvalue_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include #include struct A diff --git a/test/sync/futures/promise/set_value_at_thread_exit_const_pass.cpp b/test/sync/futures/promise/set_value_at_thread_exit_const_pass.cpp index 4972cb7d8d..40113102de 100644 --- a/test/sync/futures/promise/set_value_at_thread_exit_const_pass.cpp +++ b/test/sync/futures/promise/set_value_at_thread_exit_const_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) void func(boost::promise p) diff --git a/test/sync/futures/promise/set_value_at_thread_exit_void_pass.cpp b/test/sync/futures/promise/set_value_at_thread_exit_void_pass.cpp index c79f2a23e3..47ed7bfd99 100644 --- a/test/sync/futures/promise/set_value_at_thread_exit_void_pass.cpp +++ b/test/sync/futures/promise/set_value_at_thread_exit_void_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include int i = 0; diff --git a/test/sync/futures/promise/set_value_const_pass.cpp b/test/sync/futures/promise/set_value_const_pass.cpp index e4defb91bb..f82d80c17b 100644 --- a/test/sync/futures/promise/set_value_const_pass.cpp +++ b/test/sync/futures/promise/set_value_const_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include #include #ifdef BOOST_MSVC diff --git a/test/sync/futures/promise/set_value_void_pass.cpp b/test/sync/futures/promise/set_value_void_pass.cpp index 7c11d5b666..664e055bf2 100644 --- a/test/sync/futures/promise/set_value_void_pass.cpp +++ b/test/sync/futures/promise/set_value_void_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include #include struct A diff --git a/test/sync/futures/promise/use_allocator_pass.cpp b/test/sync/futures/promise/use_allocator_pass.cpp index 3b1e96c7eb..bd9f8d135b 100644 --- a/test/sync/futures/promise/use_allocator_pass.cpp +++ b/test/sync/futures/promise/use_allocator_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include #include #if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS diff --git a/test/sync/futures/shared_future/copy_assign_pass.cpp b/test/sync/futures/shared_future/copy_assign_pass.cpp index 1b23b2d160..24a56a63e0 100644 --- a/test/sync/futures/shared_future/copy_assign_pass.cpp +++ b/test/sync/futures/shared_future/copy_assign_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include int main() { diff --git a/test/sync/futures/shared_future/copy_ctor_pass.cpp b/test/sync/futures/shared_future/copy_ctor_pass.cpp index fd29c0fe31..4990d3bba7 100644 --- a/test/sync/futures/shared_future/copy_ctor_pass.cpp +++ b/test/sync/futures/shared_future/copy_ctor_pass.cpp @@ -20,7 +20,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include int main() { diff --git a/test/sync/futures/shared_future/default_pass.cpp b/test/sync/futures/shared_future/default_pass.cpp index 59ecea3a31..e1b74d961e 100644 --- a/test/sync/futures/shared_future/default_pass.cpp +++ b/test/sync/futures/shared_future/default_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include int main() { diff --git a/test/sync/futures/shared_future/dtor_pass.cpp b/test/sync/futures/shared_future/dtor_pass.cpp index 01fb591c04..159368e093 100644 --- a/test/sync/futures/shared_future/dtor_pass.cpp +++ b/test/sync/futures/shared_future/dtor_pass.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS #include "../test_allocator.hpp" #endif diff --git a/test/sync/futures/shared_future/get_pass.cpp b/test/sync/futures/shared_future/get_pass.cpp index 558fb024f7..b74959f55a 100644 --- a/test/sync/futures/shared_future/get_pass.cpp +++ b/test/sync/futures/shared_future/get_pass.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/futures/shared_future/move_assign_pass.cpp b/test/sync/futures/shared_future/move_assign_pass.cpp index 40ff4992c3..8dca26d3dd 100644 --- a/test/sync/futures/shared_future/move_assign_pass.cpp +++ b/test/sync/futures/shared_future/move_assign_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include boost::mutex m0; boost::mutex m1; diff --git a/test/sync/futures/shared_future/move_ctor_pass.cpp b/test/sync/futures/shared_future/move_ctor_pass.cpp index 533f5ec90c..c131559bd1 100644 --- a/test/sync/futures/shared_future/move_ctor_pass.cpp +++ b/test/sync/futures/shared_future/move_ctor_pass.cpp @@ -21,7 +21,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include boost::mutex m; diff --git a/test/sync/futures/shared_future/then_executor_pass.cpp b/test/sync/futures/shared_future/then_executor_pass.cpp index 73b42fc8ad..daffcd0e4e 100644 --- a/test/sync/futures/shared_future/then_executor_pass.cpp +++ b/test/sync/futures/shared_future/then_executor_pass.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION diff --git a/test/sync/futures/shared_future/then_pass.cpp b/test/sync/futures/shared_future/then_pass.cpp index e7cca062e1..ffa6bedaf4 100644 --- a/test/sync/futures/shared_future/then_pass.cpp +++ b/test/sync/futures/shared_future/then_pass.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION diff --git a/test/sync/futures/shared_future/wait_for_pass.cpp b/test/sync/futures/shared_future/wait_for_pass.cpp index e9d8ac6845..c87b22aea4 100644 --- a/test/sync/futures/shared_future/wait_for_pass.cpp +++ b/test/sync/futures/shared_future/wait_for_pass.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/futures/shared_future/wait_pass.cpp b/test/sync/futures/shared_future/wait_pass.cpp index d2d1b31f61..8e96b7da90 100644 --- a/test/sync/futures/shared_future/wait_pass.cpp +++ b/test/sync/futures/shared_future/wait_pass.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/futures/shared_future/wait_until_pass.cpp b/test/sync/futures/shared_future/wait_until_pass.cpp index 8b05725e7b..3568d0a6e0 100644 --- a/test/sync/futures/shared_future/wait_until_pass.cpp +++ b/test/sync/futures/shared_future/wait_until_pass.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/futures/when_all/iterators_pass.cpp b/test/sync/futures/when_all/iterators_pass.cpp index 2646074f09..c13b8064e1 100644 --- a/test/sync/futures/when_all/iterators_pass.cpp +++ b/test/sync/futures/when_all/iterators_pass.cpp @@ -28,7 +28,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include #include #ifdef BOOST_MSVC diff --git a/test/sync/futures/when_all/none_pass.cpp b/test/sync/futures/when_all/none_pass.cpp index 613e2368da..ca4d2c8ddf 100644 --- a/test/sync/futures/when_all/none_pass.cpp +++ b/test/sync/futures/when_all/none_pass.cpp @@ -26,7 +26,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include int main() { diff --git a/test/sync/futures/when_all/one_pass.cpp b/test/sync/futures/when_all/one_pass.cpp index 026abcf53a..68397e8cae 100644 --- a/test/sync/futures/when_all/one_pass.cpp +++ b/test/sync/futures/when_all/one_pass.cpp @@ -27,7 +27,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include #include #ifdef BOOST_MSVC diff --git a/test/sync/futures/when_all/variadic_pass.cpp b/test/sync/futures/when_all/variadic_pass.cpp index f3b93b8be5..205776fa3e 100644 --- a/test/sync/futures/when_all/variadic_pass.cpp +++ b/test/sync/futures/when_all/variadic_pass.cpp @@ -27,7 +27,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include #include #ifdef BOOST_MSVC diff --git a/test/sync/futures/when_any/iterators_pass.cpp b/test/sync/futures/when_any/iterators_pass.cpp index 03336d0226..d33ebd191a 100644 --- a/test/sync/futures/when_any/iterators_pass.cpp +++ b/test/sync/futures/when_any/iterators_pass.cpp @@ -28,7 +28,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include #include #ifdef BOOST_MSVC diff --git a/test/sync/futures/when_any/none_pass.cpp b/test/sync/futures/when_any/none_pass.cpp index 2edd0bc6d2..672988e3c1 100644 --- a/test/sync/futures/when_any/none_pass.cpp +++ b/test/sync/futures/when_any/none_pass.cpp @@ -26,7 +26,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include int main() { diff --git a/test/sync/futures/when_any/one_pass.cpp b/test/sync/futures/when_any/one_pass.cpp index 61882ef6d8..ba2ee738d7 100644 --- a/test/sync/futures/when_any/one_pass.cpp +++ b/test/sync/futures/when_any/one_pass.cpp @@ -26,7 +26,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include #ifdef BOOST_MSVC #pragma warning(disable: 4127) // conditional expression is constant diff --git a/test/sync/futures/when_any/variadic_pass.cpp b/test/sync/futures/when_any/variadic_pass.cpp index 09b3951fcb..9d12ccf844 100644 --- a/test/sync/futures/when_any/variadic_pass.cpp +++ b/test/sync/futures/when_any/variadic_pass.cpp @@ -26,7 +26,7 @@ #define BOOST_THREAD_VERSION 4 #include -#include +#include #include #ifdef BOOST_MSVC diff --git a/test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp b/test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp index bd9ff152fc..c373ed5946 100644 --- a/test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include class non_copyable diff --git a/test/sync/mutual_exclusion/locks/lock_guard/adopt_lock_pass.cpp b/test/sync/mutual_exclusion/locks/lock_guard/adopt_lock_pass.cpp index b6039c5560..a366a7c1f6 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/adopt_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/adopt_lock_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "../../../../timming.hpp" #ifdef BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp index a3957c7502..28eacd525b 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::mutex m0; boost::mutex m1; diff --git a/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp index 5c1b3a1c20..5eff72a307 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::mutex m0; boost::mutex m1; diff --git a/test/sync/mutual_exclusion/locks/lock_guard/default_pass.cpp b/test/sync/mutual_exclusion/locks/lock_guard/default_pass.cpp index 4fcc26a9b4..18a7d2a250 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/default_pass.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/default_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "../../../../timming.hpp" #ifdef BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_fail.cpp b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_fail.cpp index 9aab78dddf..7e456c0ee5 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_fail.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_fail.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include boost::mutex m; diff --git a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_pass.cpp b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_pass.cpp index a158677ad6..57d6ac18d7 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_pass.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_pass.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include boost::mutex m; diff --git a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_fail.cpp b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_fail.cpp index eead4501cb..921f0b4ef9 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_fail.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_fail.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include boost::mutex m; diff --git a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_pass.cpp b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_pass.cpp index aee2e40e41..d9a01003a4 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_pass.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_pass.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include boost::mutex m; diff --git a/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_adopt_lock_pass.cpp b/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_adopt_lock_pass.cpp index cecdc84ce0..806ae293b9 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_adopt_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_adopt_lock_pass.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include "../../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_pass.cpp b/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_pass.cpp index 853fae7439..ec8dacc04d 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_pass.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_pass.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include "../../../../timming.hpp" #ifdef BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/locks/lock_guard/types_pass.cpp b/test/sync/mutual_exclusion/locks/lock_guard/types_pass.cpp index 7c2d39375d..4a351d3625 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/types_pass.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/types_pass.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_assign_fail.cpp index c5d9a39b55..350310af86 100644 --- a/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_assign_fail.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include boost::mutex m0; boost::mutex m1; diff --git a/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_ctor_fail.cpp index 1c0abf94a2..6426d7e935 100644 --- a/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_ctor_fail.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include boost::mutex m0; boost::mutex m1; diff --git a/test/sync/mutual_exclusion/locks/nested_strict_lock/default_pass.cpp b/test/sync/mutual_exclusion/locks/nested_strict_lock/default_pass.cpp index 0182bdd95e..fc0b0cd70f 100644 --- a/test/sync/mutual_exclusion/locks/nested_strict_lock/default_pass.cpp +++ b/test/sync/mutual_exclusion/locks/nested_strict_lock/default_pass.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include "../../../../timming.hpp" #ifdef BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/locks/nested_strict_lock/make_nested_strict_lock_pass.cpp b/test/sync/mutual_exclusion/locks/nested_strict_lock/make_nested_strict_lock_pass.cpp index 5a10728cb8..e47f1e1597 100644 --- a/test/sync/mutual_exclusion/locks/nested_strict_lock/make_nested_strict_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/nested_strict_lock/make_nested_strict_lock_pass.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include "../../../../timming.hpp" #ifdef BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/locks/nested_strict_lock/owns_lock_pass.cpp b/test/sync/mutual_exclusion/locks/nested_strict_lock/owns_lock_pass.cpp index be06b6a06a..c75f836c5b 100644 --- a/test/sync/mutual_exclusion/locks/nested_strict_lock/owns_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/nested_strict_lock/owns_lock_pass.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/nested_strict_lock/types_pass.cpp b/test/sync/mutual_exclusion/locks/nested_strict_lock/types_pass.cpp index 5a7c690e41..60b99513c7 100644 --- a/test/sync/mutual_exclusion/locks/nested_strict_lock/types_pass.cpp +++ b/test/sync/mutual_exclusion/locks/nested_strict_lock/types_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/reverse_lock/types_pass.cpp b/test/sync/mutual_exclusion/locks/reverse_lock/types_pass.cpp index 13a17fd3aa..f3bb77d20a 100644 --- a/test/sync/mutual_exclusion/locks/reverse_lock/types_pass.cpp +++ b/test/sync/mutual_exclusion/locks/reverse_lock/types_pass.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/reverse_lock/unique_lock_ctor_pass.cpp b/test/sync/mutual_exclusion/locks/reverse_lock/unique_lock_ctor_pass.cpp index 57a1f1e01b..6578336d16 100644 --- a/test/sync/mutual_exclusion/locks/reverse_lock/unique_lock_ctor_pass.cpp +++ b/test/sync/mutual_exclusion/locks/reverse_lock/unique_lock_ctor_pass.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include int main() diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/adopt_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/adopt_lock_pass.cpp index f9089e7a81..1a970565d7 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/adopt_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/adopt_lock_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include int main() diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_assign_fail.cpp index 2bc99f34b7..34cfec9ed7 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_assign_fail.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::shared_mutex m0; boost::shared_mutex m1; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_ctor_fail.cpp index 43fddebe87..af3e67b278 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_ctor_fail.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::shared_mutex m0; boost::shared_mutex m1; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/default_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/default_pass.cpp index 9ccae93b75..055d3746a8 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/default_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/default_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/defer_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/defer_lock_pass.cpp index 84388aca4c..ed707f8982 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/defer_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/defer_lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/duration_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/duration_pass.cpp index 45037c2241..1279ff0151 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/duration_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/duration_pass.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include "../../../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp index ef54e229f9..1874580482 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::shared_mutex m0; boost::shared_mutex m1; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp index 307c761425..d91e1fbf63 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_unique_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_unique_lock_pass.cpp index 38f6e7d7db..b9bdb39af5 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_unique_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_unique_lock_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_upgrade_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_upgrade_lock_pass.cpp index 36ecb6a5ae..b778095db9 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_upgrade_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_upgrade_lock_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/mutex_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/mutex_pass.cpp index f50aa6199a..0860107a08 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/mutex_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "../../../../../timming.hpp" boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/time_point_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/time_point_pass.cpp index 41d9cd8f98..641527349e 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/time_point_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/time_point_pass.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include "../../../../../timming.hpp" boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/try_to_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/try_to_lock_pass.cpp index 5f3036c0ce..e5866110d9 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/try_to_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/try_to_lock_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "../../../../../timming.hpp" boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/locking/lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/locking/lock_pass.cpp index 456c26dfdd..65099f44d8 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/locking/lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/locking/lock_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include "../../../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_for_pass.cpp index 07d32df397..a5997890d4 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_for_pass.cpp @@ -21,7 +21,7 @@ #include //#include -#include +#include bool try_lock_for_called = false; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_pass.cpp index 6a19972382..00e4c1a003 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_pass.cpp @@ -21,7 +21,7 @@ #include //#include -#include +#include bool try_lock_called = false; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp index cdfd0e1615..44d92c83b0 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include bool try_lock_until_called = false; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/locking/unlock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/locking/unlock_pass.cpp index e8ed7c74cc..87f34c0d78 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/locking/unlock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/locking/unlock_pass.cpp @@ -21,7 +21,7 @@ #include //#include -#include +#include bool unlock_called = false; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/mod/member_swap_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/mod/member_swap_pass.cpp index 11f366bd66..65f37e7a9e 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/mod/member_swap_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/mod/member_swap_pass.cpp @@ -19,7 +19,7 @@ // void swap(shared_lock& u); #include -#include +#include struct shared_mutex { diff --git a/test/sync/mutual_exclusion/locks/shared_lock/mod/non_member_swap_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/mod/non_member_swap_pass.cpp index c0ccb8b9d2..1b5db8411c 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/mod/non_member_swap_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/mod/non_member_swap_pass.cpp @@ -18,7 +18,7 @@ // void swap(shared_lock& x, shared_lock& y); #include -#include +#include struct shared_mutex { diff --git a/test/sync/mutual_exclusion/locks/shared_lock/mod/release_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/mod/release_pass.cpp index c39ca50aa0..d9e2aba2e8 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/mod/release_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/mod/release_pass.cpp @@ -19,7 +19,7 @@ // void Mutex* release(); #include -#include +#include struct shared_mutex { diff --git a/test/sync/mutual_exclusion/locks/shared_lock/obs/mutex_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/obs/mutex_pass.cpp index 2012186ae8..3656f7357f 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/obs/mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/obs/mutex_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/obs/op_bool_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/obs/op_bool_pass.cpp index 407bfcc6f0..fe8666c459 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/obs/op_bool_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/obs/op_bool_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/obs/owns_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/obs/owns_lock_pass.cpp index dce14d3e9a..a0486f3135 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/obs/owns_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/obs/owns_lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/shared_lock/types_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/types_pass.cpp index 2f83ef98ff..73f96466df 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/types_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/types_pass.cpp @@ -28,7 +28,8 @@ #include #include #include -#include +#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp index fe125e8a03..0b8197b16d 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "../../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp index 43607ac264..c5db439703 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::shared_mutex m0; boost::shared_mutex m1; diff --git a/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp index a7d4f006d7..ce39fa55bf 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::shared_mutex m0; boost::shared_mutex m1; diff --git a/test/sync/mutual_exclusion/locks/shared_lock_guard/default_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock_guard/default_pass.cpp index 694ba4a147..76ff543a64 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock_guard/default_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock_guard/default_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include "../../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/locks/shared_lock_guard/types_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock_guard/types_pass.cpp index 57a2116d13..cc5a312d4d 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock_guard/types_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock_guard/types_pass.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/strict_lock/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/strict_lock/copy_assign_fail.cpp index 1852224bb5..af3666a432 100644 --- a/test/sync/mutual_exclusion/locks/strict_lock/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/strict_lock/copy_assign_fail.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include boost::mutex m0; boost::mutex m1; diff --git a/test/sync/mutual_exclusion/locks/strict_lock/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/strict_lock/copy_ctor_fail.cpp index 331610cb1d..ec1baabb57 100644 --- a/test/sync/mutual_exclusion/locks/strict_lock/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/strict_lock/copy_ctor_fail.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include boost::mutex m0; boost::mutex m1; diff --git a/test/sync/mutual_exclusion/locks/strict_lock/default_pass.cpp b/test/sync/mutual_exclusion/locks/strict_lock/default_pass.cpp index aa2fb00719..cd1bfb56bc 100644 --- a/test/sync/mutual_exclusion/locks/strict_lock/default_pass.cpp +++ b/test/sync/mutual_exclusion/locks/strict_lock/default_pass.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include "../../../../timming.hpp" #ifdef BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/locks/strict_lock/make_strict_lock_pass.cpp b/test/sync/mutual_exclusion/locks/strict_lock/make_strict_lock_pass.cpp index c5a3069f0e..72adab31a4 100644 --- a/test/sync/mutual_exclusion/locks/strict_lock/make_strict_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/strict_lock/make_strict_lock_pass.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include "../../../../timming.hpp" #ifdef BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/locks/strict_lock/owns_lock_pass.cpp b/test/sync/mutual_exclusion/locks/strict_lock/owns_lock_pass.cpp index c0c2ec8619..4e40d0c716 100644 --- a/test/sync/mutual_exclusion/locks/strict_lock/owns_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/strict_lock/owns_lock_pass.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #ifdef BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; diff --git a/test/sync/mutual_exclusion/locks/strict_lock/types_pass.cpp b/test/sync/mutual_exclusion/locks/strict_lock/types_pass.cpp index f813e5ca8f..4b546b1a2a 100644 --- a/test/sync/mutual_exclusion/locks/strict_lock/types_pass.cpp +++ b/test/sync/mutual_exclusion/locks/strict_lock/types_pass.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/adopt_lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/adopt_lock_pass.cpp index 42d33378ef..0e705d67e0 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/adopt_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/adopt_lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include int main() diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_assign_fail.cpp index d69a1eec72..3ba4e2a54c 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_assign_fail.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::mutex m0; boost::mutex m1; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_ctor_fail.cpp index 08fc3c344f..9bd7d17e5b 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_ctor_fail.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::mutex m0; boost::mutex m1; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/default_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/default_pass.cpp index 7989b8173c..d09a2a0a22 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/default_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/default_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/defer_lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/defer_lock_pass.cpp index 5045af26e9..d855a48552 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/defer_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/defer_lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/duration_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/duration_pass.cpp index 19aa0575fe..f19be6fa3d 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/duration_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/duration_pass.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include "../../../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_adopt_lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_adopt_lock_pass.cpp index 2f385ec875..718ea76198 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_adopt_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_adopt_lock_pass.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_defer_lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_defer_lock_pass.cpp index e32fad1681..9bea91ee7b 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_defer_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_defer_lock_pass.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_mutex_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_mutex_pass.cpp index 97b6255640..53beaddd19 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_mutex_pass.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include "../../../../../timming.hpp" //#if ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_try_to_lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_try_to_lock_pass.cpp index d0149d9063..b3d58b0483 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_try_to_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_try_to_lock_pass.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include "../../../../../timming.hpp" boost::mutex m; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_locks_mutex_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_locks_mutex_pass.cpp index 72c574b200..ee6645244f 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_locks_mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_locks_mutex_pass.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include "../../../../../timming.hpp" #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && ! defined BOOST_THREAD_NO_MAKE_UNIQUE_LOCKS && ! defined BOOST_NO_CXX11_RVALUE_REFERENCES diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp index 7c84d15202..25ecd5ff2f 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::mutex m0; boost::mutex m1; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp index cf682fbd47..738bd2bad0 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::mutex m; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_for_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_for_pass.cpp index 0e61cb1a75..7a728e6013 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_for_pass.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_try_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_try_pass.cpp index 3068866f00..859af72596 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_try_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_try_pass.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_until_pass.cpp index f1e54cf45a..319650ee1a 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_until_pass.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_for_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_for_pass.cpp index 7437ee0e7d..33028f7313 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_for_pass.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include boost::upgrade_mutex m; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp index c72067ae90..91d30537f4 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::upgrade_mutex m; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_try_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_try_pass.cpp index fdbdf21655..d788f1c402 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_try_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_try_pass.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include boost::upgrade_mutex m; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_until_pass.cpp index cd33f709cd..c3c80d0702 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_until_pass.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include boost::upgrade_mutex m; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/mutex_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/mutex_pass.cpp index d5b7ca2957..f8a5d6fad7 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/mutex_pass.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include "../../../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/time_point_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/time_point_pass.cpp index 53358de6e2..47bd9428b2 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/time_point_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/time_point_pass.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "../../../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/try_to_lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/try_to_lock_pass.cpp index 0f0c8ded4b..3297515c2a 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/try_to_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/try_to_lock_pass.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include "../../../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/locks/unique_lock/locking/lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/locking/lock_pass.cpp index 94edb4342e..510de661ed 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/locking/lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/locking/lock_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include "../../../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_for_pass.cpp index 2be8416eb5..9ee4f88dcf 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_for_pass.cpp @@ -21,7 +21,7 @@ #include //#include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_pass.cpp index 8553c1c0b0..47c5ffb222 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_pass.cpp @@ -21,7 +21,7 @@ #include //#include -#include +#include bool try_lock_called = false; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp index df6e7369ea..90e80aadca 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/locks/unique_lock/locking/unlock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/locking/unlock_pass.cpp index 4ad954f247..fa20757f6c 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/locking/unlock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/locking/unlock_pass.cpp @@ -20,7 +20,7 @@ #include //#include -#include +#include bool unlock_called = false; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/mod/member_swap_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/mod/member_swap_pass.cpp index 617682fe39..f4b32836ae 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/mod/member_swap_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/mod/member_swap_pass.cpp @@ -19,7 +19,7 @@ // void swap(unique_lock& u); #include -#include +#include struct mutex { diff --git a/test/sync/mutual_exclusion/locks/unique_lock/mod/non_member_swap_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/mod/non_member_swap_pass.cpp index 74ba5ff3ff..b7b69cb855 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/mod/non_member_swap_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/mod/non_member_swap_pass.cpp @@ -18,7 +18,7 @@ // void swap(unique_lock& x, unique_lock& y); #include -#include +#include struct mutex { diff --git a/test/sync/mutual_exclusion/locks/unique_lock/mod/release_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/mod/release_pass.cpp index 63c3831e52..fe9715da21 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/mod/release_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/mod/release_pass.cpp @@ -19,7 +19,7 @@ // void Mutex* release(); #include -#include +#include struct mutex { diff --git a/test/sync/mutual_exclusion/locks/unique_lock/obs/mutex_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/obs/mutex_pass.cpp index 68f1bbb6d1..5d5949a8d8 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/obs/mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/obs/mutex_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::mutex m; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/obs/op_bool_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/obs/op_bool_pass.cpp index 3fa18225a8..c56fabdbdc 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/obs/op_bool_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/obs/op_bool_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::mutex m; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/obs/op_int_fail.cpp b/test/sync/mutual_exclusion/locks/unique_lock/obs/op_int_fail.cpp index 92fe0ffcb9..733c7daa90 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/obs/op_int_fail.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/obs/op_int_fail.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::mutex m; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/obs/owns_lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/obs/owns_lock_pass.cpp index 6a9f019aa4..380e91430d 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/obs/owns_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/obs/owns_lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include int main() diff --git a/test/sync/mutual_exclusion/locks/unique_lock/types_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/types_pass.cpp index 69b963a6f0..e00f550793 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/types_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/types_pass.cpp @@ -28,7 +28,8 @@ #include #include #include -#include +#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/adopt_lock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/adopt_lock_pass.cpp index 1822fe0b63..7849c14927 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/adopt_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/adopt_lock_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include int main() diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_assign_fail.cpp index 521304d817..e1a0f9f38c 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_assign_fail.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::shared_mutex m0; boost::shared_mutex m1; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_ctor_fail.cpp index 8e20196b1f..1ddbf5200b 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_ctor_fail.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::shared_mutex m0; boost::shared_mutex m1; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/default_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/default_pass.cpp index 59ea2a9a2a..983264b421 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/default_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/default_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/defer_lock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/defer_lock_pass.cpp index ececb845c9..4902cd2a37 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/defer_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/defer_lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/duration_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/duration_pass.cpp index b6506b9b32..59882d2c02 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/duration_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/duration_pass.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include "../../../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp index 42ef355c9a..8f91b84a2c 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::shared_mutex m0; boost::shared_mutex m1; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp index 5d5c0a9482..300e771d0c 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_for_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_for_pass.cpp index ccad7b1ac9..2246fa2f30 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_for_pass.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_try_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_try_pass.cpp index 93deda8c33..5181bed7c5 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_try_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_try_pass.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_until_pass.cpp index 3d2c2871b7..796582a782 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_until_pass.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_unique_lock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_unique_lock_pass.cpp index 3d591d1761..8917de647e 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_unique_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_unique_lock_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/mutex_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/mutex_pass.cpp index 1e634807db..67d318c4f4 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/mutex_pass.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include "../../../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/time_point_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/time_point_pass.cpp index 4cf71476b2..ac55125229 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/time_point_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/time_point_pass.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "../../../../../timming.hpp" boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/try_to_lock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/try_to_lock_pass.cpp index 9a7fe26bff..91be65dede 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/try_to_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/try_to_lock_pass.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include "../../../../../timming.hpp" boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/lock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/lock_pass.cpp index 2ff49ac96e..7ec16f839b 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/lock_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include "../../../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_for_pass.cpp index 5f8f4f5fec..6f4fd6426e 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_for_pass.cpp @@ -21,7 +21,7 @@ #include //#include -#include +#include bool try_lock_for_called = false; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_pass.cpp index 820fd71a36..05721fc476 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_pass.cpp @@ -21,7 +21,7 @@ #include //#include -#include +#include bool try_lock_called = false; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp index 1c53d6a5bc..1587074d9c 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include bool try_lock_until_called = false; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/unlock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/unlock_pass.cpp index bc49a04339..c9daae9a00 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/unlock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/unlock_pass.cpp @@ -21,7 +21,7 @@ #include //#include -#include +#include bool unlock_called = false; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/mod/member_swap_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/mod/member_swap_pass.cpp index 4b0752ef5e..68b8eaa55b 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/mod/member_swap_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/mod/member_swap_pass.cpp @@ -19,7 +19,7 @@ // void swap(upgrade_lock& u); #include -#include +#include struct shared_mutex { diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/mod/non_member_swap_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/mod/non_member_swap_pass.cpp index c7ebaa271b..7c64642f98 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/mod/non_member_swap_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/mod/non_member_swap_pass.cpp @@ -18,7 +18,7 @@ // void swap(upgrade_lock& x, upgrade_lock& y); #include -#include +#include struct shared_mutex { diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/mod/release_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/mod/release_pass.cpp index 226819446a..ca01e36402 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/mod/release_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/mod/release_pass.cpp @@ -19,7 +19,7 @@ // void Mutex* release(); #include -#include +#include struct shared_mutex { diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/obs/mutex_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/obs/mutex_pass.cpp index 276cd0a932..a923087267 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/obs/mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/obs/mutex_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/obs/op_bool_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/obs/op_bool_pass.cpp index 4e722d174f..ae891de4a5 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/obs/op_bool_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/obs/op_bool_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/obs/owns_lock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/obs/owns_lock_pass.cpp index 9d8b80d697..72b904c23f 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/obs/owns_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/obs/owns_lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/types_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/types_pass.cpp index 876428e465..f1bc6410ca 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/types_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/types_pass.cpp @@ -28,7 +28,8 @@ #include #include #include -#include +#include +#include int main() { diff --git a/test/sync/mutual_exclusion/mutex/assign_fail.cpp b/test/sync/mutual_exclusion/mutex/assign_fail.cpp index fa1aff9b58..5e4827bf51 100644 --- a/test/sync/mutual_exclusion/mutex/assign_fail.cpp +++ b/test/sync/mutual_exclusion/mutex/assign_fail.cpp @@ -19,7 +19,7 @@ // mutex& operator=(const mutex&) = delete; #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/mutex/copy_fail.cpp b/test/sync/mutual_exclusion/mutex/copy_fail.cpp index e6f6d6b88a..3a091cd90c 100644 --- a/test/sync/mutual_exclusion/mutex/copy_fail.cpp +++ b/test/sync/mutual_exclusion/mutex/copy_fail.cpp @@ -19,7 +19,7 @@ // mutex(const mutex&) = delete; #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/mutex/default_pass.cpp b/test/sync/mutual_exclusion/mutex/default_pass.cpp index a911eefcf4..a55dfcd9bc 100644 --- a/test/sync/mutual_exclusion/mutex/default_pass.cpp +++ b/test/sync/mutual_exclusion/mutex/default_pass.cpp @@ -19,7 +19,7 @@ // mutex(); #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/mutex/lock_compile_fail.cpp b/test/sync/mutual_exclusion/mutex/lock_compile_fail.cpp index f6bf74b569..acdc35b88d 100644 --- a/test/sync/mutual_exclusion/mutex/lock_compile_fail.cpp +++ b/test/sync/mutual_exclusion/mutex/lock_compile_fail.cpp @@ -8,7 +8,7 @@ // class mutex; #include -#include +#include void fail() { diff --git a/test/sync/mutual_exclusion/mutex/lock_compile_pass.cpp b/test/sync/mutual_exclusion/mutex/lock_compile_pass.cpp index 9da22a59df..53dfabdc39 100644 --- a/test/sync/mutual_exclusion/mutex/lock_compile_pass.cpp +++ b/test/sync/mutual_exclusion/mutex/lock_compile_pass.cpp @@ -8,7 +8,7 @@ // class mutex; #include -#include +#include void pass() { diff --git a/test/sync/mutual_exclusion/mutex/lock_pass.cpp b/test/sync/mutual_exclusion/mutex/lock_pass.cpp index 94818fbad0..13b94834f7 100644 --- a/test/sync/mutual_exclusion/mutex/lock_pass.cpp +++ b/test/sync/mutual_exclusion/mutex/lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include "../../../timming.hpp" boost::mutex m; diff --git a/test/sync/mutual_exclusion/mutex/native_handle_pass.cpp b/test/sync/mutual_exclusion/mutex/native_handle_pass.cpp index 489ec375d2..63b6b51f77 100644 --- a/test/sync/mutual_exclusion/mutex/native_handle_pass.cpp +++ b/test/sync/mutual_exclusion/mutex/native_handle_pass.cpp @@ -20,7 +20,7 @@ // native_handle_type native_handle(); #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/mutex/try_lock_compile_fail.cpp b/test/sync/mutual_exclusion/mutex/try_lock_compile_fail.cpp index 05c2016cb8..139b826dee 100644 --- a/test/sync/mutual_exclusion/mutex/try_lock_compile_fail.cpp +++ b/test/sync/mutual_exclusion/mutex/try_lock_compile_fail.cpp @@ -8,7 +8,7 @@ // class mutex; #include -#include +#include void fail() { diff --git a/test/sync/mutual_exclusion/mutex/try_lock_compile_pass.cpp b/test/sync/mutual_exclusion/mutex/try_lock_compile_pass.cpp index e4cec906a9..0b381468a1 100644 --- a/test/sync/mutual_exclusion/mutex/try_lock_compile_pass.cpp +++ b/test/sync/mutual_exclusion/mutex/try_lock_compile_pass.cpp @@ -8,7 +8,7 @@ // class mutex; #include -#include +#include void pass() { diff --git a/test/sync/mutual_exclusion/mutex/try_lock_pass.cpp b/test/sync/mutual_exclusion/mutex/try_lock_pass.cpp index b973c1b239..1c503d2be7 100644 --- a/test/sync/mutual_exclusion/mutex/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/mutex/try_lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include "../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/null_mutex/assign_fail.cpp b/test/sync/mutual_exclusion/null_mutex/assign_fail.cpp index e8b440abd0..64a74e42db 100644 --- a/test/sync/mutual_exclusion/null_mutex/assign_fail.cpp +++ b/test/sync/mutual_exclusion/null_mutex/assign_fail.cpp @@ -19,7 +19,7 @@ // null_mutex& operator=(const null_mutex&) = delete; #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/null_mutex/copy_fail.cpp b/test/sync/mutual_exclusion/null_mutex/copy_fail.cpp index 66668f5e01..80e7cca92e 100644 --- a/test/sync/mutual_exclusion/null_mutex/copy_fail.cpp +++ b/test/sync/mutual_exclusion/null_mutex/copy_fail.cpp @@ -19,7 +19,7 @@ // null_mutex(const null_mutex&) = delete; #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/null_mutex/default_pass.cpp b/test/sync/mutual_exclusion/null_mutex/default_pass.cpp index 343431a9e2..eb2f620e77 100644 --- a/test/sync/mutual_exclusion/null_mutex/default_pass.cpp +++ b/test/sync/mutual_exclusion/null_mutex/default_pass.cpp @@ -19,7 +19,7 @@ // null_mutex(); #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/null_mutex/lock_pass.cpp b/test/sync/mutual_exclusion/null_mutex/lock_pass.cpp index 3c91e25f61..793878114c 100644 --- a/test/sync/mutual_exclusion/null_mutex/lock_pass.cpp +++ b/test/sync/mutual_exclusion/null_mutex/lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include "../../../timming.hpp" boost::null_mutex m; diff --git a/test/sync/mutual_exclusion/null_mutex/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/null_mutex/try_lock_for_pass.cpp index 1f5f5e9fc9..891b06e308 100644 --- a/test/sync/mutual_exclusion/null_mutex/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/null_mutex/try_lock_for_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include "../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/null_mutex/try_lock_pass.cpp b/test/sync/mutual_exclusion/null_mutex/try_lock_pass.cpp index cc51928bbf..1bdd71faff 100644 --- a/test/sync/mutual_exclusion/null_mutex/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/null_mutex/try_lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include "../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/null_mutex/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/null_mutex/try_lock_until_pass.cpp index 8a6985165c..d03cb9ddbf 100644 --- a/test/sync/mutual_exclusion/null_mutex/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/null_mutex/try_lock_until_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include "../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/once/call_once/call_once_pass.cpp b/test/sync/mutual_exclusion/once/call_once/call_once_pass.cpp index ac7b807695..cb6c26e2c0 100644 --- a/test/sync/mutual_exclusion/once/call_once/call_once_pass.cpp +++ b/test/sync/mutual_exclusion/once/call_once/call_once_pass.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #ifdef BOOST_THREAD_PROVIDES_ONCE_CXX11 #define BOOST_INIT_ONCE_INIT diff --git a/test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp b/test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp index 05a6282301..b47a396e91 100644 --- a/test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include class non_copyable diff --git a/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp b/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp index 041102e911..74a8dd8422 100644 --- a/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp +++ b/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp @@ -19,7 +19,7 @@ // recursive_mutex& operator=(const recursive_mutex&) = delete; #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/recursive_mutex/copy_fail.cpp b/test/sync/mutual_exclusion/recursive_mutex/copy_fail.cpp index 932422d15f..f12a21dc5e 100644 --- a/test/sync/mutual_exclusion/recursive_mutex/copy_fail.cpp +++ b/test/sync/mutual_exclusion/recursive_mutex/copy_fail.cpp @@ -19,7 +19,7 @@ // recursive_mutex(const recursive_mutex&) = delete; #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/recursive_mutex/default_pass.cpp b/test/sync/mutual_exclusion/recursive_mutex/default_pass.cpp index 6b61997201..b0d3b81e76 100644 --- a/test/sync/mutual_exclusion/recursive_mutex/default_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_mutex/default_pass.cpp @@ -19,7 +19,7 @@ // recursive_mutex(); #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/recursive_mutex/lock_pass.cpp b/test/sync/mutual_exclusion/recursive_mutex/lock_pass.cpp index a5410d25e1..f52d9fd2b3 100644 --- a/test/sync/mutual_exclusion/recursive_mutex/lock_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_mutex/lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include "../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/recursive_mutex/native_handle_pass.cpp b/test/sync/mutual_exclusion/recursive_mutex/native_handle_pass.cpp index b784f24e5e..0f5e5b923e 100644 --- a/test/sync/mutual_exclusion/recursive_mutex/native_handle_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_mutex/native_handle_pass.cpp @@ -20,7 +20,7 @@ // native_handle_type native_handle(); #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/recursive_mutex/try_lock_pass.cpp b/test/sync/mutual_exclusion/recursive_mutex/try_lock_pass.cpp index 0f8fe822a9..a88e26249d 100644 --- a/test/sync/mutual_exclusion/recursive_mutex/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_mutex/try_lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include "../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/assign_fail.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/assign_fail.cpp index 48b9cc47d0..f6e215a303 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/assign_fail.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/assign_fail.cpp @@ -19,7 +19,7 @@ // recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete; #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/copy_fail.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/copy_fail.cpp index b4e96c7ac9..62a4e9c9de 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/copy_fail.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/copy_fail.cpp @@ -19,7 +19,7 @@ // recursive_timed_mutex(const recursive_timed_mutex&) = delete; #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/default_pass.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/default_pass.cpp index 1e75b7b049..ef6107ee0d 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/default_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/default_pass.cpp @@ -19,7 +19,7 @@ // recursive_timed_mutex(); #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/lock_pass.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/lock_pass.cpp index bd0646f64a..4762db2c76 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/lock_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include "../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/native_handle_pass.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/native_handle_pass.cpp index bcd375e535..d0c4487bb5 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/native_handle_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/native_handle_pass.cpp @@ -20,7 +20,7 @@ // native_handle_type native_handle(); #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp index c7f6d2b0b7..3b8c1a962d 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include "../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_pass.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_pass.cpp index 3874d68539..7a92af4e8b 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include "../../../timming.hpp" boost::recursive_timed_mutex m; diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_until_pass.cpp index 2384672045..f028ea96f7 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_until_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include "../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/shared_mutex/assign_fail.cpp b/test/sync/mutual_exclusion/shared_mutex/assign_fail.cpp index ee6446d7ee..e67795e030 100644 --- a/test/sync/mutual_exclusion/shared_mutex/assign_fail.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/assign_fail.cpp @@ -19,7 +19,7 @@ // shared_mutex& operator=(const shared_mutex&) = delete; #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/shared_mutex/copy_fail.cpp b/test/sync/mutual_exclusion/shared_mutex/copy_fail.cpp index 9627f9f668..280546d90f 100644 --- a/test/sync/mutual_exclusion/shared_mutex/copy_fail.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/copy_fail.cpp @@ -19,7 +19,7 @@ // shared_mutex(const shared_mutex&) = delete; #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/shared_mutex/default_pass.cpp b/test/sync/mutual_exclusion/shared_mutex/default_pass.cpp index 730c9cafca..a0bbaccfd0 100644 --- a/test/sync/mutual_exclusion/shared_mutex/default_pass.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/default_pass.cpp @@ -19,7 +19,7 @@ // shared_mutex(); #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/shared_mutex/lock_pass.cpp b/test/sync/mutual_exclusion/shared_mutex/lock_pass.cpp index 0b53fb2752..d8d1b8cb3c 100644 --- a/test/sync/mutual_exclusion/shared_mutex/lock_pass.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include "../../../timming.hpp" boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/shared_mutex/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/shared_mutex/try_lock_for_pass.cpp index bc06576ecd..207456def0 100644 --- a/test/sync/mutual_exclusion/shared_mutex/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/try_lock_for_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include "../../../timming.hpp" boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/shared_mutex/try_lock_pass.cpp b/test/sync/mutual_exclusion/shared_mutex/try_lock_pass.cpp index 515589a6fb..b52995cafd 100644 --- a/test/sync/mutual_exclusion/shared_mutex/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/try_lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include "../../../timming.hpp" boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/shared_mutex/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/shared_mutex/try_lock_until_pass.cpp index dd8a1a8162..42ac0e46a1 100644 --- a/test/sync/mutual_exclusion/shared_mutex/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/try_lock_until_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include "../../../timming.hpp" boost::shared_mutex m; diff --git a/test/sync/mutual_exclusion/sync_bounded_queue/multi_thread_pass.cpp b/test/sync/mutual_exclusion/sync_bounded_queue/multi_thread_pass.cpp index 9975a995a7..c7e74a912f 100644 --- a/test/sync/mutual_exclusion/sync_bounded_queue/multi_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_bounded_queue/multi_thread_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include struct call_push { diff --git a/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp index 201e0bc13f..49b90fa5f5 100644 --- a/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp @@ -14,7 +14,7 @@ #include -#include +#include class non_copyable { diff --git a/test/sync/mutual_exclusion/sync_deque/multi_thread_pass.cpp b/test/sync/mutual_exclusion/sync_deque/multi_thread_pass.cpp index 703c54f40b..e63fff8c9c 100644 --- a/test/sync/mutual_exclusion/sync_deque/multi_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_deque/multi_thread_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include template struct call_push_back diff --git a/test/sync/mutual_exclusion/sync_deque/single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_deque/single_thread_pass.cpp index 5170bcf614..4cebae3c3b 100644 --- a/test/sync/mutual_exclusion/sync_deque/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_deque/single_thread_pass.cpp @@ -13,7 +13,7 @@ #include -#include +#include class non_copyable { diff --git a/test/sync/mutual_exclusion/sync_pq/pq_multi_thread_pass.cpp b/test/sync/mutual_exclusion/sync_pq/pq_multi_thread_pass.cpp index 92e183079d..fb91828301 100644 --- a/test/sync/mutual_exclusion/sync_pq/pq_multi_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_pq/pq_multi_thread_pass.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #ifdef BOOST_MSVC diff --git a/test/sync/mutual_exclusion/sync_pq/pq_single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_pq/pq_single_thread_pass.cpp index b51827731a..d705df8eb6 100644 --- a/test/sync/mutual_exclusion/sync_pq/pq_single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_pq/pq_single_thread_pass.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include "../../../timming.hpp" using namespace boost::chrono; diff --git a/test/sync/mutual_exclusion/sync_pq/tq_multi_thread_pass.cpp b/test/sync/mutual_exclusion/sync_pq/tq_multi_thread_pass.cpp index 77656f8b38..17ee30f30b 100644 --- a/test/sync/mutual_exclusion/sync_pq/tq_multi_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_pq/tq_multi_thread_pass.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include "../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/sync_pq/tq_single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_pq/tq_single_thread_pass.cpp index dd4dfc17fb..13fb84d3ac 100644 --- a/test/sync/mutual_exclusion/sync_pq/tq_single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_pq/tq_single_thread_pass.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/test/sync/mutual_exclusion/sync_queue/multi_thread_pass.cpp b/test/sync/mutual_exclusion/sync_queue/multi_thread_pass.cpp index 556ca68e97..3c26dbc6cc 100644 --- a/test/sync/mutual_exclusion/sync_queue/multi_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_queue/multi_thread_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include template struct call_push diff --git a/test/sync/mutual_exclusion/sync_queue/single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_queue/single_thread_pass.cpp index 8f47ec82ad..49445bbd62 100644 --- a/test/sync/mutual_exclusion/sync_queue/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_queue/single_thread_pass.cpp @@ -13,7 +13,7 @@ #include -#include +#include class non_copyable { diff --git a/test/sync/mutual_exclusion/synchronized_value/call_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/call_pass.cpp index f1ed8be4a9..57045110d9 100644 --- a/test/sync/mutual_exclusion/synchronized_value/call_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/call_pass.cpp @@ -23,7 +23,7 @@ #include -#include +#include struct S { int f() const {return 1;} diff --git a/test/sync/mutual_exclusion/synchronized_value/copy_T_assign_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/copy_T_assign_pass.cpp index 3b43f8f908..21cbbc2291 100644 --- a/test/sync/mutual_exclusion/synchronized_value/copy_T_assign_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/copy_T_assign_pass.cpp @@ -13,7 +13,7 @@ #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/synchronized_value/copy_T_ctor_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/copy_T_ctor_pass.cpp index e395c57aad..f95ae6caa7 100644 --- a/test/sync/mutual_exclusion/synchronized_value/copy_T_ctor_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/copy_T_ctor_pass.cpp @@ -13,7 +13,7 @@ #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/synchronized_value/copy_assign_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/copy_assign_pass.cpp index d4e80b0ce9..d282b6e5d7 100644 --- a/test/sync/mutual_exclusion/synchronized_value/copy_assign_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/copy_assign_pass.cpp @@ -13,7 +13,7 @@ #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/synchronized_value/copy_ctor_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/copy_ctor_pass.cpp index 13fcf6d800..b30f66cb08 100644 --- a/test/sync/mutual_exclusion/synchronized_value/copy_ctor_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/copy_ctor_pass.cpp @@ -13,7 +13,7 @@ #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/synchronized_value/default_ctor_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/default_ctor_pass.cpp index 7b40956503..3ceb5455ce 100644 --- a/test/sync/mutual_exclusion/synchronized_value/default_ctor_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/default_ctor_pass.cpp @@ -13,7 +13,7 @@ #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/synchronized_value/indirect_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/indirect_pass.cpp index 09b8e89d21..785c9d4eeb 100644 --- a/test/sync/mutual_exclusion/synchronized_value/indirect_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/indirect_pass.cpp @@ -14,7 +14,7 @@ #include -#include +#include struct S { int f() const {return 1;} diff --git a/test/sync/mutual_exclusion/synchronized_value/move_T_assign_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/move_T_assign_pass.cpp index 146ed2e51d..5ada80582e 100644 --- a/test/sync/mutual_exclusion/synchronized_value/move_T_assign_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/move_T_assign_pass.cpp @@ -13,7 +13,7 @@ #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/synchronized_value/move_T_ctor_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/move_T_ctor_pass.cpp index 564d57da8c..3a7e7960df 100644 --- a/test/sync/mutual_exclusion/synchronized_value/move_T_ctor_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/move_T_ctor_pass.cpp @@ -13,7 +13,7 @@ #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/synchronized_value/move_assign_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/move_assign_pass.cpp index 8182163820..d1ccc607ad 100644 --- a/test/sync/mutual_exclusion/synchronized_value/move_assign_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/move_assign_pass.cpp @@ -13,7 +13,7 @@ #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/synchronized_value/move_ctor_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/move_ctor_pass.cpp index 7250e896f9..b0eb259ed3 100644 --- a/test/sync/mutual_exclusion/synchronized_value/move_ctor_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/move_ctor_pass.cpp @@ -13,7 +13,7 @@ #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/synchronized_value/swap_T_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/swap_T_pass.cpp index 801b514d65..0a0ff30a1e 100644 --- a/test/sync/mutual_exclusion/synchronized_value/swap_T_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/swap_T_pass.cpp @@ -13,7 +13,7 @@ #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/synchronized_value/swap_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/swap_pass.cpp index c52069ff3c..22caeadb75 100644 --- a/test/sync/mutual_exclusion/synchronized_value/swap_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/swap_pass.cpp @@ -13,7 +13,7 @@ #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/synchronized_value/synchronize_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/synchronize_pass.cpp index af24d79b65..d27c58e654 100644 --- a/test/sync/mutual_exclusion/synchronized_value/synchronize_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/synchronize_pass.cpp @@ -15,7 +15,7 @@ #include -#include +#include struct S { int f() const {return 1;} diff --git a/test/sync/mutual_exclusion/timed_mutex/assign_fail.cpp b/test/sync/mutual_exclusion/timed_mutex/assign_fail.cpp index 49188e1309..4b9972155c 100644 --- a/test/sync/mutual_exclusion/timed_mutex/assign_fail.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/assign_fail.cpp @@ -19,7 +19,7 @@ // timed_mutex& operator=(const timed_mutex&) = delete; #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/timed_mutex/copy_fail.cpp b/test/sync/mutual_exclusion/timed_mutex/copy_fail.cpp index ed0a4c9552..3977196e69 100644 --- a/test/sync/mutual_exclusion/timed_mutex/copy_fail.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/copy_fail.cpp @@ -19,7 +19,7 @@ // timed_mutex(const timed_mutex&) = delete; #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/timed_mutex/default_pass.cpp b/test/sync/mutual_exclusion/timed_mutex/default_pass.cpp index 6b7c6f2b32..c5ac77d9db 100644 --- a/test/sync/mutual_exclusion/timed_mutex/default_pass.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/default_pass.cpp @@ -19,7 +19,7 @@ // timed_mutex(); #include -#include +#include int main() { diff --git a/test/sync/mutual_exclusion/timed_mutex/lock_pass.cpp b/test/sync/mutual_exclusion/timed_mutex/lock_pass.cpp index 8d2733e1f1..50079a8157 100644 --- a/test/sync/mutual_exclusion/timed_mutex/lock_pass.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include "../../../timming.hpp" boost::timed_mutex m; diff --git a/test/sync/mutual_exclusion/timed_mutex/native_handle_pass.cpp b/test/sync/mutual_exclusion/timed_mutex/native_handle_pass.cpp index b203e5d911..32a4c0d386 100644 --- a/test/sync/mutual_exclusion/timed_mutex/native_handle_pass.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/native_handle_pass.cpp @@ -20,7 +20,7 @@ // native_handle_type native_handle(); #include -#include +#include int main() diff --git a/test/sync/mutual_exclusion/timed_mutex/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/timed_mutex/try_lock_for_pass.cpp index 94d790e0e5..04774a3c8b 100644 --- a/test/sync/mutual_exclusion/timed_mutex/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/try_lock_for_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include "../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/timed_mutex/try_lock_pass.cpp b/test/sync/mutual_exclusion/timed_mutex/try_lock_pass.cpp index 96e99e7f74..3f87564b46 100644 --- a/test/sync/mutual_exclusion/timed_mutex/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/try_lock_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include "../../../timming.hpp" diff --git a/test/sync/mutual_exclusion/timed_mutex/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/timed_mutex/try_lock_until_pass.cpp index 958a42d03d..b4f8490586 100644 --- a/test/sync/mutual_exclusion/timed_mutex/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/try_lock_until_pass.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include "../../../timming.hpp" #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_bind.cpp b/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_bind.cpp index 9ec0dfdfb0..e5e073b608 100644 --- a/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_bind.cpp +++ b/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_bind.cpp @@ -8,11 +8,12 @@ #define BOOST_THREAD_VERSION 4 -#include // BOOST_TEST +#include // BOOST_TEST #include #include #include +#include class Foo { public: diff --git a/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_lambda.cpp b/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_lambda.cpp index 8eda53deaa..d0e41423ef 100644 --- a/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_lambda.cpp +++ b/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_lambda.cpp @@ -14,7 +14,7 @@ #define BOOST_THREAD_VERSION 4 -#include // BOOST_TEST +#include // BOOST_TEST #include // std::cout #include diff --git a/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_move.cpp b/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_move.cpp index 2c685790d4..cb4cc920b6 100644 --- a/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_move.cpp +++ b/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_move.cpp @@ -8,7 +8,7 @@ #define BOOST_THREAD_VERSION 4 -#include // BOOST_TEST +#include // BOOST_TEST #include #include diff --git a/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_simple.cpp b/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_simple.cpp index dc9c44455b..876be358b0 100644 --- a/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_simple.cpp +++ b/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_simple.cpp @@ -8,7 +8,7 @@ #define BOOST_THREAD_VERSION 4 -#include // BOOST_TEST +#include // BOOST_TEST #include #include diff --git a/test/test_10963.cpp b/test/test_10963.cpp index 1ec8d6cfc9..31b6ca041e 100644 --- a/test/test_10963.cpp +++ b/test/test_10963.cpp @@ -15,6 +15,7 @@ #include #include +#include struct TestCallback { @@ -42,18 +43,18 @@ int main() boost::promise test_promise; boost::future test_future(test_promise.get_future()); auto f1 = test_future.then(TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); auto f2 = f1.then(TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); } { boost::basic_thread_pool executor; boost::promise test_promise; boost::future test_future(test_promise.get_future()); auto f1 = test_future.then(executor, TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); auto f2 = f1.then(executor, TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); } #endif diff --git a/test/test_10964.cpp b/test/test_10964.cpp index 48ee5cd95f..c1712ac965 100644 --- a/test/test_10964.cpp +++ b/test/test_10964.cpp @@ -16,6 +16,8 @@ #include #include +#include + struct TestCallback { typedef boost::future result_type; @@ -77,7 +79,7 @@ int main() std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; { auto f1 = boost::make_ready_future().then(TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); f1.wait(); } std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; @@ -85,11 +87,11 @@ int main() { auto f1 = boost::make_ready_future().then(TestCallback()); std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; auto f2 = f1.unwrap(); std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; - BOOST_STATIC_ASSERT(std::is_same >::value); + BOOST_STATIC_ASSERT(boost::is_same >::value); std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; f2.wait(); std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; @@ -98,26 +100,26 @@ int main() for (int i=0; i< number_of_tests; i++) { auto f1 = boost::make_ready_future().then(TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); boost::future f2 = f1.get(); } std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; { auto f1 = boost::make_ready_future().then(TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); auto f3 = f1.then(TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); f3.wait(); } std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; for (int i=0; i< number_of_tests; i++) { auto f1 = boost::make_ready_future().then(TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); auto f2 = f1.unwrap(); - BOOST_STATIC_ASSERT(std::is_same >::value); + BOOST_STATIC_ASSERT(boost::is_same >::value); auto f3 = f2.then(TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); f3.wait(); } std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; @@ -137,9 +139,9 @@ int main() for (int i=0; i< number_of_tests; i++) { auto f1 = boost::make_ready_future().then(TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); auto f3 = f1.then(TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); f3.wait(); } std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; @@ -147,9 +149,9 @@ int main() { boost::basic_thread_pool executor; auto f1 = boost::make_ready_future().then(executor, TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); auto f3 = f1.then(executor, TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); f3.wait(); } #if 1 @@ -160,14 +162,14 @@ int main() boost::basic_thread_pool executor(2); auto f1 = boost::make_ready_future().then(executor, TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); std::cout << __FILE__ << "[" << __LINE__ << "] " << int(f1.valid()) << std::endl; auto f2 = f1.unwrap(); std::cout << __FILE__ << "[" << __LINE__ << "] " << int(f2.valid()) << std::endl; - BOOST_STATIC_ASSERT(std::is_same >::value); + BOOST_STATIC_ASSERT(boost::is_same >::value); auto f3 = f2.then(executor, TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); f3.wait(); } #endif @@ -177,11 +179,11 @@ int main() boost::basic_thread_pool executor; auto f1 = boost::make_ready_future().then(executor, TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); auto f2 = f1.unwrap(); - BOOST_STATIC_ASSERT(std::is_same >::value); + BOOST_STATIC_ASSERT(boost::is_same >::value); auto f3 = f2.then(executor, TestCallback()); - BOOST_STATIC_ASSERT(std::is_same > >::value); + BOOST_STATIC_ASSERT(boost::is_same > >::value); f3.wait(); } std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; diff --git a/test/test_2309.cpp b/test/test_2309.cpp index c3208f97fe..f25dfa5062 100644 --- a/test/test_2309.cpp +++ b/test/test_2309.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include using namespace std; diff --git a/test/test_2741.cpp b/test/test_2741.cpp index 349d7d2ae8..258b4ecfc4 100644 --- a/test/test_2741.cpp +++ b/test/test_2741.cpp @@ -8,9 +8,6 @@ #include #include -#include -#include -#include #include #include @@ -75,5 +72,3 @@ BOOST_AUTO_TEST_CASE(test_creation_with_attrs) { timed_test(&do_test_creation_with_attrs, 1); } - - diff --git a/test/test_3837.cpp b/test/test_3837.cpp index fd0056f33c..c179ab3113 100644 --- a/test/test_3837.cpp +++ b/test/test_3837.cpp @@ -7,7 +7,8 @@ #include #include #include -#include +#include +#include using namespace boost; using namespace boost::chrono; diff --git a/test/test_4648.cpp b/test/test_4648.cpp index 34fb131afe..2752d59249 100644 --- a/test/test_4648.cpp +++ b/test/test_4648.cpp @@ -6,6 +6,7 @@ #include #include #include +#include class boostThreadLocksTest { diff --git a/test/test_5502.cpp b/test/test_5502.cpp index 455e79eec1..7978997280 100644 --- a/test/test_5502.cpp +++ b/test/test_5502.cpp @@ -12,12 +12,13 @@ int XXX = 20; int YYY = 10; +#include #include #include //#include #include -#include +#include using namespace std; diff --git a/test/test_7328.cpp b/test/test_7328.cpp index 0c0cca03a6..2be6846854 100644 --- a/test/test_7328.cpp +++ b/test/test_7328.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/test_8557.cpp b/test/test_8557.cpp index b8efee5a1e..f76a7ec224 100644 --- a/test/test_8557.cpp +++ b/test/test_8557.cpp @@ -10,8 +10,6 @@ #include -#include - #include static void diff --git a/test/test_8943.cpp b/test/test_8943.cpp index 99cf70de19..14be451599 100644 --- a/test/test_8943.cpp +++ b/test/test_8943.cpp @@ -3,7 +3,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) -#include +#include #if defined(WIN32) #include diff --git a/test/test_8960.cpp b/test/test_8960.cpp index 84cce77e4f..6a7c03a3d0 100644 --- a/test/test_8960.cpp +++ b/test/test_8960.cpp @@ -5,14 +5,12 @@ #include #include - -#include +#include #include #include #include -//#include -#include +#include void do_thread() diff --git a/test/test_9303.cpp b/test/test_9303.cpp index af8be567dd..6bdaa2a145 100644 --- a/test/test_9303.cpp +++ b/test/test_9303.cpp @@ -4,6 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #define BOOST_THREAD_VERSION 4 + #include #include #include #include @@ -11,6 +12,7 @@ #include #include #include + #include #include #include #include @@ -86,7 +88,7 @@ #if defined EXAMPLE_3 //! Doesn't compile in C++03. - //! error: variable âboost::packaged_task(std::basic_string&)> exampleâ has initializer but incomplete type + //! error: variable "boost::packaged_task(std::basic_string&)> example" has initializer but incomplete type { boost::packaged_task example(string_with_params); diff --git a/test/test_barrier.cpp b/test/test_barrier.cpp index 5baf19cd44..1882217398 100644 --- a/test/test_barrier.cpp +++ b/test/test_barrier.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include namespace { diff --git a/test/test_barrier_size_fct.cpp b/test/test_barrier_size_fct.cpp index 2671af8485..ff8a7612ff 100644 --- a/test/test_barrier_size_fct.cpp +++ b/test/test_barrier_size_fct.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include namespace { diff --git a/test/test_barrier_void_fct.cpp b/test/test_barrier_void_fct.cpp index 77a65e5814..0572864f88 100644 --- a/test/test_barrier_void_fct.cpp +++ b/test/test_barrier_void_fct.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include namespace { diff --git a/test/test_completion_latch.cpp b/test/test_completion_latch.cpp index bef8836547..252908b1e2 100644 --- a/test/test_completion_latch.cpp +++ b/test/test_completion_latch.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include namespace diff --git a/test/test_latch.cpp b/test/test_latch.cpp index e2972c9b13..deecd36128 100644 --- a/test/test_latch.cpp +++ b/test/test_latch.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include namespace diff --git a/test/test_lock_concept.cpp b/test/test_lock_concept.cpp index ba7de5cd64..3b0cc2e2e6 100644 --- a/test/test_lock_concept.cpp +++ b/test/test_lock_concept.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/test/test_ml.cpp b/test/test_ml.cpp index 61b7eff569..d2ca3c038f 100644 --- a/test/test_ml.cpp +++ b/test/test_ml.cpp @@ -6,7 +6,8 @@ #include #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -#include +#include +#include #include #include #include diff --git a/test/test_mutex.cpp b/test/test_mutex.cpp index e6ac24e271..d581a053de 100644 --- a/test/test_mutex.cpp +++ b/test/test_mutex.cpp @@ -16,6 +16,8 @@ #include #include +#include + #define BOOST_TEST_MODULE Boost.Threads: mutex test suite #include diff --git a/test/test_scheduler.cpp b/test/test_scheduler.cpp index 5847ff0100..193bd4c5c6 100644 --- a/test/test_scheduler.cpp +++ b/test/test_scheduler.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/test/test_scheduling_adaptor.cpp b/test/test_scheduling_adaptor.cpp index 38c073bda8..4fe11a10ae 100644 --- a/test/test_scheduling_adaptor.cpp +++ b/test/test_scheduling_adaptor.cpp @@ -14,6 +14,7 @@ #define BOOST_THREAD_PROVIDES_EXECUTORS #include +#include #include #include #include diff --git a/test/test_thread.cpp b/test/test_thread.cpp index ab9ddba0dc..8706cd9a2a 100644 --- a/test/test_thread.cpp +++ b/test/test_thread.cpp @@ -13,8 +13,8 @@ #include #include #include -#include -#include +#include +#include #define BOOST_TEST_MODULE Boost.Threads: thread test suite diff --git a/test/test_thread_launching.cpp b/test/test_thread_launching.cpp index 0c74871d3c..5e1c4b1eb6 100644 --- a/test/test_thread_launching.cpp +++ b/test/test_thread_launching.cpp @@ -8,8 +8,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/test/test_thread_mf.cpp b/test/test_thread_mf.cpp index 843008fa70..413652dadc 100644 --- a/test/test_thread_mf.cpp +++ b/test/test_thread_mf.cpp @@ -8,7 +8,7 @@ #define BOOST_THREAD_VERSION 3 #include -#include +#include struct X { diff --git a/test/test_time_jumps.cpp b/test/test_time_jumps.cpp index 706bafa479..705bf11d5f 100644 --- a/test/test_time_jumps.cpp +++ b/test/test_time_jumps.cpp @@ -4,18 +4,19 @@ #include #endif -#include "boost/bind/bind.hpp" -#include "boost/chrono.hpp" -#include "boost/chrono/ceil.hpp" -#include "boost/date_time.hpp" -#include "boost/thread/concurrent_queues/sync_priority_queue.hpp" -#include "boost/thread/concurrent_queues/sync_timed_queue.hpp" -#include "boost/thread/future.hpp" -#include "boost/thread/mutex.hpp" -#include "boost/thread/recursive_mutex.hpp" -#include "boost/thread/shared_lock_guard.hpp" -#include "boost/thread/shared_mutex.hpp" -#include "boost/thread/thread.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #ifdef TEST_CPP14_FEATURES diff --git a/test/threads/container/thread_ptr_list_pass.cpp b/test/threads/container/thread_ptr_list_pass.cpp index 76047051f5..2727d036f7 100644 --- a/test/threads/container/thread_ptr_list_pass.cpp +++ b/test/threads/container/thread_ptr_list_pass.cpp @@ -10,9 +10,9 @@ #include #include //#include -#include +#include #include -#include +#include int count = 0; diff --git a/test/threads/container/thread_vector_pass.cpp b/test/threads/container/thread_vector_pass.cpp index 059a77e366..6c45317d61 100644 --- a/test/threads/container/thread_vector_pass.cpp +++ b/test/threads/container/thread_vector_pass.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include int count = 0; diff --git a/test/threads/this_thread/get_id/get_id_pass.cpp b/test/threads/this_thread/get_id/get_id_pass.cpp index f0287cb6ac..2020ba447b 100644 --- a/test/threads/this_thread/get_id/get_id_pass.cpp +++ b/test/threads/this_thread/get_id/get_id_pass.cpp @@ -17,7 +17,7 @@ #include -#include +#include int main() { diff --git a/test/threads/this_thread/sleep_for/sleep_for_pass.cpp b/test/threads/this_thread/sleep_for/sleep_for_pass.cpp index 05c5a790db..09a18f00b2 100644 --- a/test/threads/this_thread/sleep_for/sleep_for_pass.cpp +++ b/test/threads/this_thread/sleep_for/sleep_for_pass.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/threads/this_thread/sleep_until/sleep_until_pass.cpp b/test/threads/this_thread/sleep_until/sleep_until_pass.cpp index 232712eedb..8aed8f6225 100644 --- a/test/threads/this_thread/sleep_until/sleep_until_pass.cpp +++ b/test/threads/this_thread/sleep_until/sleep_until_pass.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/threads/thread/assign/copy_fail.cpp b/test/threads/thread/assign/copy_fail.cpp index 5ccac5b315..80c50f59d7 100644 --- a/test/threads/thread/assign/copy_fail.cpp +++ b/test/threads/thread/assign/copy_fail.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include class G { diff --git a/test/threads/thread/assign/move_pass.cpp b/test/threads/thread/assign/move_pass.cpp index 293c5d838b..a5344f6231 100644 --- a/test/threads/thread/assign/move_pass.cpp +++ b/test/threads/thread/assign/move_pass.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include class G { diff --git a/test/threads/thread/constr/FArgs_pass.cpp b/test/threads/thread/constr/FArgs_pass.cpp index e12c51878f..ed0a2891b1 100644 --- a/test/threads/thread/constr/FArgs_pass.cpp +++ b/test/threads/thread/constr/FArgs_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include unsigned throw_one = 0xFFFF; diff --git a/test/threads/thread/constr/F_pass.cpp b/test/threads/thread/constr/F_pass.cpp index b99e90babf..de6c2635f0 100644 --- a/test/threads/thread/constr/F_pass.cpp +++ b/test/threads/thread/constr/F_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include unsigned throw_one = 0xFFFF; diff --git a/test/threads/thread/constr/FrvalueArgs_pass.cpp b/test/threads/thread/constr/FrvalueArgs_pass.cpp index e76db70229..0c81e91b3a 100644 --- a/test/threads/thread/constr/FrvalueArgs_pass.cpp +++ b/test/threads/thread/constr/FrvalueArgs_pass.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include class MoveOnly { diff --git a/test/threads/thread/constr/Frvalue_pass.cpp b/test/threads/thread/constr/Frvalue_pass.cpp index 38061e0a76..dfddf3aac3 100644 --- a/test/threads/thread/constr/Frvalue_pass.cpp +++ b/test/threads/thread/constr/Frvalue_pass.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include class MoveOnly diff --git a/test/threads/thread/constr/copy_fail.cpp b/test/threads/thread/constr/copy_fail.cpp index caa72c2d85..6a26853339 100644 --- a/test/threads/thread/constr/copy_fail.cpp +++ b/test/threads/thread/constr/copy_fail.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include class G { diff --git a/test/threads/thread/constr/default_pass.cpp b/test/threads/thread/constr/default_pass.cpp index cea602d15b..d94bf8ad94 100644 --- a/test/threads/thread/constr/default_pass.cpp +++ b/test/threads/thread/constr/default_pass.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include int main() { diff --git a/test/threads/thread/constr/lambda_pass.cpp b/test/threads/thread/constr/lambda_pass.cpp index 34a3e53c3c..441f13cd72 100644 --- a/test/threads/thread/constr/lambda_pass.cpp +++ b/test/threads/thread/constr/lambda_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #if ! defined BOOST_NO_CXX11_LAMBDAS diff --git a/test/threads/thread/constr/move_pass.cpp b/test/threads/thread/constr/move_pass.cpp index 66f9d75464..0caca29acc 100644 --- a/test/threads/thread/constr/move_pass.cpp +++ b/test/threads/thread/constr/move_pass.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include class G { diff --git a/test/threads/thread/destr/dtor_pass.cpp b/test/threads/thread/destr/dtor_pass.cpp index ea0e6bac42..4c4eebd297 100644 --- a/test/threads/thread/destr/dtor_pass.cpp +++ b/test/threads/thread/destr/dtor_pass.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include class G { diff --git a/test/threads/thread/id/hash_pass.cpp b/test/threads/thread/id/hash_pass.cpp index 6ce52c97a2..645f903359 100644 --- a/test/threads/thread/id/hash_pass.cpp +++ b/test/threads/thread/id/hash_pass.cpp @@ -24,7 +24,7 @@ #include -#include +#include int main() { diff --git a/test/threads/thread/members/detach_pass.cpp b/test/threads/thread/members/detach_pass.cpp index 927175338b..59ce8a62f8 100644 --- a/test/threads/thread/members/detach_pass.cpp +++ b/test/threads/thread/members/detach_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include class G { diff --git a/test/threads/thread/members/get_id_pass.cpp b/test/threads/thread/members/get_id_pass.cpp index dcaa7090bc..459495030f 100644 --- a/test/threads/thread/members/get_id_pass.cpp +++ b/test/threads/thread/members/get_id_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include class G { diff --git a/test/threads/thread/members/join_pass.cpp b/test/threads/thread/members/join_pass.cpp index f2d42b72bc..322f48156c 100644 --- a/test/threads/thread/members/join_pass.cpp +++ b/test/threads/thread/members/join_pass.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include class G { diff --git a/test/threads/thread/members/joinable_pass.cpp b/test/threads/thread/members/joinable_pass.cpp index dcf09d1f83..d0e4de9154 100644 --- a/test/threads/thread/members/joinable_pass.cpp +++ b/test/threads/thread/members/joinable_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include class G { diff --git a/test/threads/thread/members/native_handle_pass.cpp b/test/threads/thread/members/native_handle_pass.cpp index 01115da051..7f4fbcbd44 100644 --- a/test/threads/thread/members/native_handle_pass.cpp +++ b/test/threads/thread/members/native_handle_pass.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include class G { diff --git a/test/threads/thread/members/swap_pass.cpp b/test/threads/thread/members/swap_pass.cpp index 16af2d1b8e..427306aa07 100644 --- a/test/threads/thread/members/swap_pass.cpp +++ b/test/threads/thread/members/swap_pass.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include class G { diff --git a/test/threads/thread/members/try_join_for_pass.cpp b/test/threads/thread/members/try_join_for_pass.cpp index 5215d18d6a..41b357ac52 100644 --- a/test/threads/thread/members/try_join_for_pass.cpp +++ b/test/threads/thread/members/try_join_for_pass.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/threads/thread/members/try_join_until_pass.cpp b/test/threads/thread/members/try_join_until_pass.cpp index 749ff5b064..ed9d2ad65c 100644 --- a/test/threads/thread/members/try_join_until_pass.cpp +++ b/test/threads/thread/members/try_join_until_pass.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #if defined BOOST_THREAD_USES_CHRONO diff --git a/test/threads/thread/non_members/swap_pass.cpp b/test/threads/thread/non_members/swap_pass.cpp index eb6faf1579..5726ab2cc5 100644 --- a/test/threads/thread/non_members/swap_pass.cpp +++ b/test/threads/thread/non_members/swap_pass.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include class G { diff --git a/test/threads/thread/static/hardware_concurrency_pass.cpp b/test/threads/thread/static/hardware_concurrency_pass.cpp index 2a2a227ed9..5dcd5cd696 100644 --- a/test/threads/thread/static/hardware_concurrency_pass.cpp +++ b/test/threads/thread/static/hardware_concurrency_pass.cpp @@ -18,7 +18,7 @@ // static unsigned hardware_concurrency(); #include -#include +#include int main() { diff --git a/test/timming.hpp b/test/timming.hpp index 92c4d3972d..c978f5d9dd 100644 --- a/test/timming.hpp +++ b/test/timming.hpp @@ -7,7 +7,7 @@ #define BOOST_THREAD_TEST_TIMMING_HPP #include -#include +#include #if ! defined BOOST_THREAD_TEST_TIME_MS #ifdef BOOST_THREAD_PLATFORM_WIN32 From 637ceec9965156b0452cd0ccce270d6feb7bce29 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Sun, 17 Nov 2019 17:15:04 +0100 Subject: [PATCH 02/80] Fix typos in copyright headers. --- doc/emulations.qbk | 2 +- doc/overview.qbk | 2 +- doc/scoped_thread.qbk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/emulations.qbk b/doc/emulations.qbk index 61774af825..031b8c0200 100644 --- a/doc/emulations.qbk +++ b/doc/emulations.qbk @@ -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). diff --git a/doc/overview.qbk b/doc/overview.qbk index 26bb187f87..cbc040010b 100644 --- a/doc/overview.qbk +++ b/doc/overview.qbk @@ -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). diff --git a/doc/scoped_thread.qbk b/doc/scoped_thread.qbk index 13437be529..5c5f2440fd 100644 --- a/doc/scoped_thread.qbk +++ b/doc/scoped_thread.qbk @@ -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). From 7e2cd262cefce16a42c3a2cf8b9758caecbc48b2 Mon Sep 17 00:00:00 2001 From: Marcus Better Date: Mon, 7 Dec 2020 21:23:44 -0500 Subject: [PATCH 03/80] Non-template function needs inline This is to prevent multiple definition of the symbol when the file is included from multiple modules. --- include/boost/thread/experimental/parallel/v2/task_region.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/thread/experimental/parallel/v2/task_region.hpp b/include/boost/thread/experimental/parallel/v2/task_region.hpp index 02d7b1dacb..b8ec759b1e 100644 --- a/include/boost/thread/experimental/parallel/v2/task_region.hpp +++ b/include/boost/thread/experimental/parallel/v2/task_region.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; From d56f3f25adbc4c462d0cf97f280579d58ee46190 Mon Sep 17 00:00:00 2001 From: Nikita Kniazev Date: Sun, 23 Apr 2023 02:03:50 +0300 Subject: [PATCH 04/80] Win32 Clang TSA annotations. Fixes #321 --- include/boost/thread/win32/basic_timed_mutex.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/boost/thread/win32/basic_timed_mutex.hpp b/include/boost/thread/win32/basic_timed_mutex.hpp index b332dab752..f0905e665a 100644 --- a/include/boost/thread/win32/basic_timed_mutex.hpp +++ b/include/boost/thread/win32/basic_timed_mutex.hpp @@ -30,7 +30,7 @@ namespace boost { namespace detail { - struct basic_timed_mutex + struct BOOST_THREAD_CAPABILITY("mutex") basic_timed_mutex { BOOST_STATIC_CONSTANT(unsigned char,lock_flag_bit=31); BOOST_STATIC_CONSTANT(unsigned char,event_set_flag_bit=30); @@ -62,12 +62,12 @@ namespace boost } // Take the lock flag if it's available - bool try_lock() BOOST_NOEXCEPT + bool try_lock() BOOST_NOEXCEPT BOOST_THREAD_TRY_ACQUIRE(true) { return !win32::interlocked_bit_test_and_set(&active_count,lock_flag_bit); } - void lock() + void lock() BOOST_THREAD_ACQUIRE() { if(try_lock()) { @@ -93,7 +93,7 @@ namespace boost // Loop until the number of waiters has been incremented or we've taken the lock flag // The loop is necessary since this function may be called by multiple threads simultaneously - void mark_waiting_and_try_lock(long& old_count) + void mark_waiting_and_try_lock(long& old_count) BOOST_THREAD_TRY_ACQUIRE(true) { for(;;) { @@ -117,7 +117,7 @@ namespace boost // until we've taken the lock flag and cleared the event set flag and decremented the // number of waiters // The loop is necessary since this function may be called by multiple threads simultaneously - void clear_waiting_and_try_lock(long& old_count) + void clear_waiting_and_try_lock(long& old_count) BOOST_THREAD_TRY_ACQUIRE(true) { old_count&=~lock_flag_value; old_count|=event_set_flag_value; @@ -152,7 +152,7 @@ namespace boost } template - bool do_lock_until(Timepoint const& t, Duration const& max) + bool do_lock_until(Timepoint const& t, Duration const& max) BOOST_THREAD_TRY_ACQUIRE(true) { if(try_lock()) { @@ -238,7 +238,7 @@ namespace boost } #endif - void unlock() + void unlock() BOOST_THREAD_RELEASE() { // Clear the lock flag using atomic addition (works since long is always 32 bits on Windows) long const old_count=BOOST_INTERLOCKED_EXCHANGE_ADD(&active_count,lock_flag_value); From 7d570f70d8bb2a3f2e5f52453ac1f7d669c9a6cf Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 11 Sep 2023 19:32:44 +0300 Subject: [PATCH 05/80] Remove msvc-12.0 from Appveyor --- appveyor.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e4ec908f2d..0c5937f1c3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,9 +18,6 @@ image: Visual Studio 2015 environment: matrix: - - TOOLSET: msvc-12.0 - VARIANT: release - - TOOLSET: msvc-14.0 ADDRMD: 32 VARIANT: debug From 5f41e688381447c483525646a9e1ce57bf25959e Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Mon, 11 Sep 2023 21:15:28 +0300 Subject: [PATCH 06/80] Update declval.hpp include. The header is part of Boost.TypeTraits, so use the appropriate header path. --- include/boost/thread/synchronized_value.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/thread/synchronized_value.hpp b/include/boost/thread/synchronized_value.hpp index 33ef5e1224..4e48a853dd 100644 --- a/include/boost/thread/synchronized_value.hpp +++ b/include/boost/thread/synchronized_value.hpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include //#include //#include //#if ! defined BOOST_NO_CXX11_HDR_TYPE_TRAITS From 88e32fd1ac47e21ad6be30e7c21e56b01dc6c27f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 13 Sep 2023 01:55:20 +0300 Subject: [PATCH 07/80] Add cxxstd=11 to MinGW on Appveyor --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 0c5937f1c3..bc038d8e21 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -44,6 +44,7 @@ environment: - ADDPATH: C:\mingw\bin; TOOLSET: gcc + CXXSTD: 11 VARIANT: debug # The following configurations fail with From 97060416f1e5e268d862853ccbe89f2fe4ef5a25 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 13 Sep 2023 10:00:53 +0300 Subject: [PATCH 08/80] Remove MinGW from Appveyor because of an internal compiler error --- appveyor.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index bc038d8e21..4d2fa36e6a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,21 +42,24 @@ environment: TOOLSET: gcc VARIANT: release - - ADDPATH: C:\mingw\bin; - TOOLSET: gcc - CXXSTD: 11 - VARIANT: debug - # The following configurations fail with # ./boost/thread/detail/invoke.hpp:101:43: internal compiler error: in gimplify_expr, at gimplify.c:12039 # https://sourceforge.net/p/mingw-w64/bugs/694/ +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83756 +# +# - ADDPATH: C:\mingw\bin; +# TOOLSET: gcc +# CXXSTD: 11 +# VARIANT: debug # # - ADDPATH: C:\cygwin64\bin; # TOOLSET: gcc # VARIANT: debug +# # - ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin; # TOOLSET: gcc # VARIANT: debug +# # - ADDPATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin; # TOOLSET: gcc # VARIANT: debug,release From ccc5e3142c8dcd9ff97641c352bca66b83be4028 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 13 Sep 2023 11:08:17 +0300 Subject: [PATCH 09/80] Further increase test timeout --- test/timming.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/timming.hpp b/test/timming.hpp index 6ae320e8d8..09c51ff8ea 100644 --- a/test/timming.hpp +++ b/test/timming.hpp @@ -14,7 +14,7 @@ #define BOOST_THREAD_TEST_TIME_MS 75 #else // Windows, Cygwin, macOS all need this -#define BOOST_THREAD_TEST_TIME_MS 250 +#define BOOST_THREAD_TEST_TIME_MS 400 #endif #endif From 32d8199b6c6615cd2c88931262327fc2b1e26544 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 13 Oct 2023 19:24:23 +0300 Subject: [PATCH 10/80] Update meta/libraries.json --- meta/libraries.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/libraries.json b/meta/libraries.json index b146ef4beb..2250d6df55 100644 --- a/meta/libraries.json +++ b/meta/libraries.json @@ -10,11 +10,11 @@ "Vicente J. Botet Escriba " ], "description": - "Portable C++ multi-threading. C++03, C++11, C++14, C++17.", + "Portable C++ multi-threading. C++11, C++14, C++17.", "std": [ "proposal" ], "category": [ "Concurrent", "System" ], - "cxxstd": "03" + "cxxstd": "11" } ] From 515d95c4413a28aaa822e48a7a2bbc5b71921528 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 13 Oct 2023 19:46:06 +0300 Subject: [PATCH 11/80] Remove workarounds from csbl headers to reduce dependencies --- include/boost/thread/csbl/deque.hpp | 25 +---------------- include/boost/thread/csbl/functional.hpp | 15 +--------- include/boost/thread/csbl/list.hpp | 15 +--------- .../thread/csbl/memory/allocator_arg.hpp | 14 ++-------- .../thread/csbl/memory/allocator_traits.hpp | 11 -------- include/boost/thread/csbl/memory/config.hpp | 2 -- .../thread/csbl/memory/default_delete.hpp | 16 ----------- .../thread/csbl/memory/pointer_traits.hpp | 11 -------- .../thread/csbl/memory/scoped_allocator.hpp | 11 -------- .../boost/thread/csbl/memory/shared_ptr.hpp | 19 ------------- .../boost/thread/csbl/memory/unique_ptr.hpp | 8 ++---- include/boost/thread/csbl/queue.hpp | 28 ++----------------- include/boost/thread/csbl/tuple.hpp | 19 +------------ include/boost/thread/csbl/vector.hpp | 15 +--------- 14 files changed, 12 insertions(+), 197 deletions(-) diff --git a/include/boost/thread/csbl/deque.hpp b/include/boost/thread/csbl/deque.hpp index 2b26a46e1a..58da235051 100644 --- a/include/boost/thread/csbl/deque.hpp +++ b/include/boost/thread/csbl/deque.hpp @@ -9,37 +9,14 @@ #ifndef BOOST_CSBL_DEQUE_HPP #define BOOST_CSBL_DEQUE_HPP -#include -// MSVC has some trouble instantiating a non_copyable type -//C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0(606) : error C2248: 'non_copyable::non_copyable' : cannot access private member declared in class 'non_copyable' -// ..\libs\thread\test\sync\mutual_exclusion\queue_views\single_thread_pass.cpp(24) : see declaration of 'non_copyable::non_copyable' -// ..\libs\thread\test\sync\mutual_exclusion\queue_views\single_thread_pass.cpp(23) : see declaration of 'non_copyable' -// C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0(605) : while compiling class template member function 'void std::allocator<_Ty>::construct(_Ty *,const _Ty &)' -// with -// [ -// _Ty=non_copyable -// ] -#if defined BOOST_THREAD_USES_BOOST_DEQUE || defined BOOST_NO_CXX11_RVALUE_REFERENCES || (defined _MSC_VER && _MSC_FULL_VER < 180020827) -#ifndef BOOST_THREAD_USES_BOOST_DEQUE -#define BOOST_THREAD_USES_BOOST_DEQUE -#endif -#include -#else #include -#endif namespace boost { namespace csbl { -#if defined BOOST_THREAD_USES_BOOST_DEQUE - using ::boost::container::deque; - -#else using ::std::deque; - -#endif - } } + #endif // header diff --git a/include/boost/thread/csbl/functional.hpp b/include/boost/thread/csbl/functional.hpp index 7a7e928b70..0fc339a245 100644 --- a/include/boost/thread/csbl/functional.hpp +++ b/include/boost/thread/csbl/functional.hpp @@ -9,24 +9,12 @@ #ifndef BOOST_CSBL_FUNCTIONAL_HPP #define BOOST_CSBL_FUNCTIONAL_HPP -#include - #include -#if defined BOOST_THREAD_USES_BOOST_FUNCTIONAL || defined BOOST_NO_CXX11_HDR_FUNCTIONAL || defined BOOST_NO_CXX11_RVALUE_REFERENCES -#ifndef BOOST_THREAD_USES_BOOST_FUNCTIONAL -#define BOOST_THREAD_USES_BOOST_FUNCTIONAL -#endif -#include -#endif - namespace boost { namespace csbl { -#if defined BOOST_THREAD_USES_BOOST_FUNCTIONAL - using ::boost::function; -#else // D.8.1, base (deprecated): // 20.9.3, reference_wrapper: // 20.9.4, arithmetic operations: @@ -42,8 +30,7 @@ namespace boost // 20.9.11 polymorphic function wrappers: using ::std::function; // 20.9.12, hash function primary template: -#endif - } } + #endif // header diff --git a/include/boost/thread/csbl/list.hpp b/include/boost/thread/csbl/list.hpp index 52ff45d349..b6286ad026 100644 --- a/include/boost/thread/csbl/list.hpp +++ b/include/boost/thread/csbl/list.hpp @@ -9,27 +9,14 @@ #ifndef BOOST_CSBL_LIST_HPP #define BOOST_CSBL_LIST_HPP -#include - -#if defined BOOST_THREAD_USES_BOOST_LIST || defined BOOST_NO_CXX11_RVALUE_REFERENCES -#ifndef BOOST_THREAD_USES_BOOST_LIST -#define BOOST_THREAD_USES_BOOST_LIST -#endif -#include -#else #include -#endif namespace boost { namespace csbl { -#if defined BOOST_THREAD_USES_BOOST_LIST - using ::boost::container::list; -#else using ::std::list; -#endif - } } + #endif // header diff --git a/include/boost/thread/csbl/memory/allocator_arg.hpp b/include/boost/thread/csbl/memory/allocator_arg.hpp index 354cdaee88..d63bf87984 100644 --- a/include/boost/thread/csbl/memory/allocator_arg.hpp +++ b/include/boost/thread/csbl/memory/allocator_arg.hpp @@ -12,18 +12,7 @@ #include // 20.7.6, allocator argument tag -#if defined BOOST_NO_CXX11_ALLOCATOR -#include -namespace boost -{ - namespace csbl - { - using ::boost::container::allocator_arg_t; - using ::boost::container::allocator_arg; - } -} -#else namespace boost { namespace csbl @@ -32,10 +21,11 @@ namespace boost using ::std::allocator_arg; } } -#endif // BOOST_NO_CXX11_ALLOCATOR + namespace boost { using ::boost::csbl::allocator_arg_t; using ::boost::csbl::allocator_arg; } + #endif // header diff --git a/include/boost/thread/csbl/memory/allocator_traits.hpp b/include/boost/thread/csbl/memory/allocator_traits.hpp index 3737cd85de..4ea160dce0 100644 --- a/include/boost/thread/csbl/memory/allocator_traits.hpp +++ b/include/boost/thread/csbl/memory/allocator_traits.hpp @@ -12,17 +12,7 @@ #include // 20.7.8, allocator traits -#if defined BOOST_NO_CXX11_ALLOCATOR -#include -namespace boost -{ - namespace csbl - { - using ::boost::container::allocator_traits; - } -} -#else namespace boost { namespace csbl @@ -30,6 +20,5 @@ namespace boost using ::std::allocator_traits; } } -#endif // BOOST_NO_CXX11_POINTER_TRAITS #endif // header diff --git a/include/boost/thread/csbl/memory/config.hpp b/include/boost/thread/csbl/memory/config.hpp index 7b0596ac49..7f6ec60303 100644 --- a/include/boost/thread/csbl/memory/config.hpp +++ b/include/boost/thread/csbl/memory/config.hpp @@ -9,8 +9,6 @@ #ifndef BOOST_CSBL_MEMORY_CONFIG_HPP #define BOOST_CSBL_MEMORY_CONFIG_HPP -#include - #include #endif // header diff --git a/include/boost/thread/csbl/memory/default_delete.hpp b/include/boost/thread/csbl/memory/default_delete.hpp index d20153b309..9e887bf437 100644 --- a/include/boost/thread/csbl/memory/default_delete.hpp +++ b/include/boost/thread/csbl/memory/default_delete.hpp @@ -14,17 +14,6 @@ // 20.8.1 class template unique_ptr: // default_delete -#if defined BOOST_NO_CXX11_SMART_PTR -#include - -namespace boost -{ - namespace csbl - { - using ::boost::movelib::default_delete; - } -} -#else namespace boost { namespace csbl @@ -32,10 +21,5 @@ namespace boost using ::std::default_delete; } } -#endif // defined BOOST_NO_CXX11_SMART_PTR -namespace boost -{ - using ::boost::csbl::default_delete; -} #endif // header diff --git a/include/boost/thread/csbl/memory/pointer_traits.hpp b/include/boost/thread/csbl/memory/pointer_traits.hpp index 320f8e9e77..7956967a51 100644 --- a/include/boost/thread/csbl/memory/pointer_traits.hpp +++ b/include/boost/thread/csbl/memory/pointer_traits.hpp @@ -12,17 +12,7 @@ #include // 20.7.3, pointer traits -#if defined BOOST_NO_CXX11_ALLOCATOR -#include -namespace boost -{ - namespace csbl - { - using ::boost::intrusive::pointer_traits; - } -} -#else namespace boost { namespace csbl @@ -30,6 +20,5 @@ namespace boost using ::std::pointer_traits; } } -#endif // BOOST_NO_CXX11_ALLOCATOR #endif // header diff --git a/include/boost/thread/csbl/memory/scoped_allocator.hpp b/include/boost/thread/csbl/memory/scoped_allocator.hpp index a92f3d8514..5f4da9a492 100644 --- a/include/boost/thread/csbl/memory/scoped_allocator.hpp +++ b/include/boost/thread/csbl/memory/scoped_allocator.hpp @@ -12,17 +12,7 @@ #include // 20.7.7, uses_allocator -#if defined BOOST_NO_CXX11_ALLOCATOR -#include -namespace boost -{ - namespace csbl - { - using ::boost::container::uses_allocator; - } -} -#else namespace boost { namespace csbl @@ -30,6 +20,5 @@ namespace boost using ::std::uses_allocator; } } -#endif // BOOST_NO_CXX11_POINTER_TRAITS #endif // header diff --git a/include/boost/thread/csbl/memory/shared_ptr.hpp b/include/boost/thread/csbl/memory/shared_ptr.hpp index e9a9383723..7e136cf33f 100644 --- a/include/boost/thread/csbl/memory/shared_ptr.hpp +++ b/include/boost/thread/csbl/memory/shared_ptr.hpp @@ -11,24 +11,6 @@ #include -#if defined BOOST_NO_CXX11_SMART_PTR - -#include -#include - -namespace boost -{ - namespace csbl - { - using ::boost::shared_ptr; - using ::boost::make_shared; - } -} - -#else - -#include - namespace boost { namespace csbl @@ -38,5 +20,4 @@ namespace boost } } -#endif #endif // header diff --git a/include/boost/thread/csbl/memory/unique_ptr.hpp b/include/boost/thread/csbl/memory/unique_ptr.hpp index 17abf54e92..3c4ec0e4f8 100644 --- a/include/boost/thread/csbl/memory/unique_ptr.hpp +++ b/include/boost/thread/csbl/memory/unique_ptr.hpp @@ -13,16 +13,14 @@ #include -#include -#include - namespace boost { namespace csbl { - using ::boost::movelib::unique_ptr; - using ::boost::movelib::make_unique; + using ::std::unique_ptr; + using ::std::make_unique; } } + #endif // header diff --git a/include/boost/thread/csbl/queue.hpp b/include/boost/thread/csbl/queue.hpp index 86e3a32452..ef4eba7d8c 100644 --- a/include/boost/thread/csbl/queue.hpp +++ b/include/boost/thread/csbl/queue.hpp @@ -5,42 +5,18 @@ // // 2013/10 Vicente J. Botet Escriba // Creation. -#if 0 + #ifndef BOOST_CSBL_QUEUE_HPP #define BOOST_CSBL_QUEUE_HPP -#include -// MSVC has some trouble instantiating a non_copyable type -//C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0(606) : error C2248: 'non_copyable::non_copyable' : cannot access private member declared in class 'non_copyable' -// ..\libs\thread\test\sync\mutual_exclusion\queue_views\single_thread_pass.cpp(24) : see declaration of 'non_copyable::non_copyable' -// ..\libs\thread\test\sync\mutual_exclusion\queue_views\single_thread_pass.cpp(23) : see declaration of 'non_copyable' -// C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xmemory0(605) : while compiling class template member function 'void std::allocator<_Ty>::construct(_Ty *,const _Ty &)' -// with -// [ -// _Ty=non_copyable -// ] -#if defined BOOST_THREAD_USES_BOOST_QUEUE || defined BOOST_NO_CXX11_RVALUE_REFERENCES || (defined _MSC_VER && _MSC_FULL_VER < 180020827) -#ifndef BOOST_THREAD_USES_BOOST_QUEUE -#define BOOST_THREAD_USES_BOOST_QUEUE -#endif -#include -#else #include -#endif namespace boost { namespace csbl { -#if defined BOOST_THREAD_USES_BOOST_QUEUE - using ::boost::container::queue; - -#else using ::std::queue; - -#endif - } } + #endif // header -#endif diff --git a/include/boost/thread/csbl/tuple.hpp b/include/boost/thread/csbl/tuple.hpp index 860229ebe0..45d6dbd453 100644 --- a/include/boost/thread/csbl/tuple.hpp +++ b/include/boost/thread/csbl/tuple.hpp @@ -9,28 +9,12 @@ #ifndef BOOST_CSBL_TUPLE_HPP #define BOOST_CSBL_TUPLE_HPP -#include - -#if defined BOOST_THREAD_USES_BOOST_TUPLE || defined BOOST_NO_CXX11_HDR_TUPLE || defined BOOST_NO_CXX11_RVALUE_REFERENCES -#include -#ifndef BOOST_THREAD_USES_BOOST_TUPLE -#define BOOST_THREAD_USES_BOOST_TUPLE -#endif - -#else #include -#endif namespace boost { namespace csbl { -#if defined BOOST_THREAD_USES_BOOST_TUPLE - using ::boost::tuple; - using ::boost::get; - using ::boost::make_tuple; - //using ::boost::tuple_size; -#else // 20.4.2, class template tuple: using ::std::tuple; using ::std::get; @@ -42,8 +26,7 @@ namespace boost // 20.4.2.7, relational operators: // 20.4.2.8, allocator-related traits // 20.4.2.9, specialized algorithms: -#endif - } } + #endif // header diff --git a/include/boost/thread/csbl/vector.hpp b/include/boost/thread/csbl/vector.hpp index c77a5b143b..5f06f81d70 100644 --- a/include/boost/thread/csbl/vector.hpp +++ b/include/boost/thread/csbl/vector.hpp @@ -9,27 +9,14 @@ #ifndef BOOST_CSBL_VECTOR_HPP #define BOOST_CSBL_VECTOR_HPP -#include - -#if defined BOOST_THREAD_USES_BOOST_VECTOR || defined BOOST_NO_CXX11_RVALUE_REFERENCES || defined BOOST_MSVC -#ifndef BOOST_THREAD_USES_BOOST_VECTOR -#define BOOST_THREAD_USES_BOOST_VECTOR -#endif -#include -#else #include -#endif namespace boost { namespace csbl { -#if defined BOOST_THREAD_USES_BOOST_VECTOR - using ::boost::container::vector; -#else using ::std::vector; -#endif - } } + #endif // header From 5fb09cd1c15c7f808670e8df68ba459f73669239 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 13 Oct 2023 21:26:18 +0300 Subject: [PATCH 12/80] std::make_unique is C++14 --- include/boost/thread/csbl/memory/unique_ptr.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/thread/csbl/memory/unique_ptr.hpp b/include/boost/thread/csbl/memory/unique_ptr.hpp index 3c4ec0e4f8..220c2f4dc1 100644 --- a/include/boost/thread/csbl/memory/unique_ptr.hpp +++ b/include/boost/thread/csbl/memory/unique_ptr.hpp @@ -12,14 +12,14 @@ #define BOOST_CSBL_MEMORY_UNIQUE_PTR_HPP #include +#include namespace boost { namespace csbl { using ::std::unique_ptr; - using ::std::make_unique; - + using ::boost::make_unique; } } From a513e530435ec0060b66ac65d72f4e75ea1d3abd Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 14 Oct 2023 01:42:25 +0300 Subject: [PATCH 13/80] Avoid https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83756 --- appveyor.yml | 37 +++++++++++--------------- include/boost/thread/detail/invoke.hpp | 15 ++++++++--- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4d2fa36e6a..091a2e6620 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,27 +42,22 @@ environment: TOOLSET: gcc VARIANT: release -# The following configurations fail with -# ./boost/thread/detail/invoke.hpp:101:43: internal compiler error: in gimplify_expr, at gimplify.c:12039 -# https://sourceforge.net/p/mingw-w64/bugs/694/ -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83756 -# -# - ADDPATH: C:\mingw\bin; -# TOOLSET: gcc -# CXXSTD: 11 -# VARIANT: debug -# -# - ADDPATH: C:\cygwin64\bin; -# TOOLSET: gcc -# VARIANT: debug -# -# - ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin; -# TOOLSET: gcc -# VARIANT: debug -# -# - ADDPATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin; -# TOOLSET: gcc -# VARIANT: debug,release + - ADDPATH: C:\mingw\bin; + TOOLSET: gcc + CXXSTD: 11 + VARIANT: debug + + - ADDPATH: C:\cygwin64\bin; + TOOLSET: gcc + VARIANT: debug + + - ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin; + TOOLSET: gcc + VARIANT: debug + + - ADDPATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin; + TOOLSET: gcc + VARIANT: debug,release install: - set GIT_FETCH_JOBS=8 diff --git a/include/boost/thread/detail/invoke.hpp b/include/boost/thread/detail/invoke.hpp index b9da4afb91..ae4dd89cc6 100644 --- a/include/boost/thread/detail/invoke.hpp +++ b/include/boost/thread/detail/invoke.hpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL #include @@ -85,7 +86,13 @@ namespace boost // bullets 3 and 4 - template + // enable_if avoids + // + // ./boost/thread/detail/invoke.hpp:101:43: internal compiler error: in gimplify_expr, at gimplify.c:12039 + // https://sourceforge.net/p/mingw-w64/bugs/694/ + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83756 + + template >::type> inline auto invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0) -> decltype(boost::forward(a0).*f) @@ -93,7 +100,7 @@ namespace boost return boost::forward(a0).*f; } - template + template >::type> inline auto invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0) -> decltype((*boost::forward(a0)).*f) @@ -101,7 +108,7 @@ namespace boost return (*boost::forward(a0)).*f; } - template + template >::type> inline auto invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0) -> decltype(boost::forward(a0).*f) @@ -109,7 +116,7 @@ namespace boost return boost::forward(a0).*f; } - template + template >::type> inline auto invoke(BOOST_THREAD_RV_REF(Fp) f, BOOST_THREAD_RV_REF(A0) a0) -> decltype((*boost::forward(a0)).*f) From caa7c111d2817677178b2763a3298785221b016e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 14 Oct 2023 02:53:15 +0300 Subject: [PATCH 14/80] Add boost/thread/detail/string_trim.hpp --- include/boost/thread/detail/string_trim.hpp | 29 +++++++++++++ test/Jamfile.v2 | 5 +++ test/detail/string_trim_test.cpp | 48 +++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 include/boost/thread/detail/string_trim.hpp create mode 100644 test/detail/string_trim_test.cpp diff --git a/include/boost/thread/detail/string_trim.hpp b/include/boost/thread/detail/string_trim.hpp new file mode 100644 index 0000000000..886525f2cf --- /dev/null +++ b/include/boost/thread/detail/string_trim.hpp @@ -0,0 +1,29 @@ +#ifndef BOOST_THREAD_DETAIL_STRING_TRIM_HPP_INCLUDED +#define BOOST_THREAD_DETAIL_STRING_TRIM_HPP_INCLUDED + +// Copyright 2023 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include + +namespace boost +{ +namespace thread_detail +{ + +inline std::string string_trim( std::string const& s ) +{ + std::size_t i = s.find_first_not_of( " \t\r\n" ); + + if( i == std::string::npos ) return std::string(); + + std::size_t j = s.find_last_not_of( " \t\r\n" ); + + return s.substr( i, j + 1 - i ); +} + +} // namespace thread_detail +} // namespace boost + +#endif // #ifndef BOOST_THREAD_DETAIL_STRING_TRIM_HPP_INCLUDED diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 33a83c7c14..4d55815a85 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1099,4 +1099,9 @@ rule generate_self_contained_header_tests ; test-suite test_self_contained_headers : [ generate_self_contained_header_tests ] ; + + test-suite detail + : + [ run detail/string_trim_test.cpp ] + ; } diff --git a/test/detail/string_trim_test.cpp b/test/detail/string_trim_test.cpp new file mode 100644 index 0000000000..fe894b17d3 --- /dev/null +++ b/test/detail/string_trim_test.cpp @@ -0,0 +1,48 @@ +// Copyright 2023 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include + +int main() +{ + using boost::thread_detail::string_trim; + + BOOST_TEST_EQ( string_trim( "" ), std::string( "" ) ); + BOOST_TEST_EQ( string_trim( " " ), std::string( "" ) ); + BOOST_TEST_EQ( string_trim( " " ), std::string( "" ) ); + BOOST_TEST_EQ( string_trim( " " ), std::string( "" ) ); + + BOOST_TEST_EQ( string_trim( " \t\r\n \t\r\n" ), std::string( "" ) ); + + BOOST_TEST_EQ( string_trim( "a" ), std::string( "a" ) ); + + BOOST_TEST_EQ( string_trim( " a" ), std::string( "a" ) ); + BOOST_TEST_EQ( string_trim( " a" ), std::string( "a" ) ); + BOOST_TEST_EQ( string_trim( " a" ), std::string( "a" ) ); + + BOOST_TEST_EQ( string_trim( "a " ), std::string( "a" ) ); + BOOST_TEST_EQ( string_trim( "a " ), std::string( "a" ) ); + BOOST_TEST_EQ( string_trim( "a " ), std::string( "a" ) ); + + BOOST_TEST_EQ( string_trim( " a " ), std::string( "a" ) ); + BOOST_TEST_EQ( string_trim( " a " ), std::string( "a" ) ); + BOOST_TEST_EQ( string_trim( " a " ), std::string( "a" ) ); + + BOOST_TEST_EQ( string_trim( "a b" ), std::string( "a b" ) ); + + BOOST_TEST_EQ( string_trim( " a b" ), std::string( "a b" ) ); + BOOST_TEST_EQ( string_trim( " a b" ), std::string( "a b" ) ); + BOOST_TEST_EQ( string_trim( " a b" ), std::string( "a b" ) ); + + BOOST_TEST_EQ( string_trim( "a b " ), std::string( "a b" ) ); + BOOST_TEST_EQ( string_trim( "a b " ), std::string( "a b" ) ); + BOOST_TEST_EQ( string_trim( "a b " ), std::string( "a b" ) ); + + BOOST_TEST_EQ( string_trim( " a b " ), std::string( "a b" ) ); + BOOST_TEST_EQ( string_trim( " a b " ), std::string( "a b" ) ); + BOOST_TEST_EQ( string_trim( " a b " ), std::string( "a b" ) ); + + return boost::report_errors(); +} From 5cbc8db0364e7452ce5619057816499526375021 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 14 Oct 2023 02:59:25 +0300 Subject: [PATCH 15/80] Eliminate dependency on Algorithm --- src/pthread/thread.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index c17aca2cc4..692b1787a1 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #ifdef __GLIBC__ #include @@ -33,8 +34,6 @@ #include #endif -#include -#include #include #include @@ -535,16 +534,18 @@ namespace boost if (line.empty()) continue; - vector key_val(2); - boost::split(key_val, line, boost::is_any_of(":")); + std::size_t i = line.find( ':' ); - if (key_val.size() != 2) - return hardware_concurrency(); + if( i == std::string::npos ) + { + return hardware_concurrency(); + } + + std::string key = line.substr( 0, i ); + std::string value = line.substr( i+1 ); - string key = key_val[0]; - string value = key_val[1]; - boost::trim(key); - boost::trim(value); + key = thread_detail::string_trim( key ); + value = thread_detail::string_trim( value ); if (key == physical_id) { current_core_entry.first = boost::lexical_cast(value); From 710e6fd278ca640ea2b0adbf3fa901d83161d55a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 14 Oct 2023 03:21:14 +0300 Subject: [PATCH 16/80] Add boost/thread/detail/string_to_unsigned.hpp --- .../thread/detail/string_to_unsigned.hpp | 55 +++++++++++++++++++ test/Jamfile.v2 | 1 + test/detail/string_to_unsigned_test.cpp | 55 +++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 include/boost/thread/detail/string_to_unsigned.hpp create mode 100644 test/detail/string_to_unsigned_test.cpp diff --git a/include/boost/thread/detail/string_to_unsigned.hpp b/include/boost/thread/detail/string_to_unsigned.hpp new file mode 100644 index 0000000000..9e58aabb31 --- /dev/null +++ b/include/boost/thread/detail/string_to_unsigned.hpp @@ -0,0 +1,55 @@ +#ifndef BOOST_THREAD_DETAIL_STRING_TO_UNSIGNED_HPP_INCLUDED +#define BOOST_THREAD_DETAIL_STRING_TO_UNSIGNED_HPP_INCLUDED + +// Copyright 2023 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include + +namespace boost +{ +namespace thread_detail +{ + +inline bool string_to_unsigned( std::string const& s, unsigned& v ) +{ + v = 0; + + if( s.empty() ) + { + return false; + } + + for( char const* p = s.c_str(); *p; ++p ) + { + unsigned char ch = static_cast( *p ); + + if( ch < '0' || ch > '9' ) + { + return false; + } + + if( v > UINT_MAX / 10 ) + { + return false; + } + + unsigned q = static_cast( ch - '0' ); + + if( v == UINT_MAX / 10 && q > UINT_MAX % 10 ) + { + return false; + } + + v = v * 10 + q; + } + + return true; +} + +} // namespace thread_detail +} // namespace boost + +#endif // #ifndef BOOST_THREAD_DETAIL_STRING_TO_UNSIGNED_HPP_INCLUDED diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 4d55815a85..3f81bc07e8 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1103,5 +1103,6 @@ rule generate_self_contained_header_tests test-suite detail : [ run detail/string_trim_test.cpp ] + [ run detail/string_to_unsigned_test.cpp ] ; } diff --git a/test/detail/string_to_unsigned_test.cpp b/test/detail/string_to_unsigned_test.cpp new file mode 100644 index 0000000000..7fababa647 --- /dev/null +++ b/test/detail/string_to_unsigned_test.cpp @@ -0,0 +1,55 @@ +// Copyright 2023 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include + +int main() +{ + using boost::thread_detail::string_to_unsigned; + + unsigned v; + + BOOST_TEST_NOT( string_to_unsigned( "", v ) ) && BOOST_TEST_EQ( v, 0 ); + BOOST_TEST_NOT( string_to_unsigned( " ", v ) ) && BOOST_TEST_EQ( v, 0 ); + BOOST_TEST_NOT( string_to_unsigned( "+1", v ) ) && BOOST_TEST_EQ( v, 0 ); + BOOST_TEST_NOT( string_to_unsigned( "-1", v ) ) && BOOST_TEST_EQ( v, 0 ); + BOOST_TEST_NOT( string_to_unsigned( "abc", v ) ) && BOOST_TEST_EQ( v, 0 ); + + BOOST_TEST( string_to_unsigned( "0", v ) ) && BOOST_TEST_EQ( v, 0 ); + BOOST_TEST( string_to_unsigned( "1", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST( string_to_unsigned( "12", v ) ) && BOOST_TEST_EQ( v, 12 ); + BOOST_TEST( string_to_unsigned( "123", v ) ) && BOOST_TEST_EQ( v, 123 ); + BOOST_TEST( string_to_unsigned( "1234", v ) ) && BOOST_TEST_EQ( v, 1234 ); + BOOST_TEST( string_to_unsigned( "12345", v ) ) && BOOST_TEST_EQ( v, 12345 ); + BOOST_TEST( string_to_unsigned( "123456", v ) ) && BOOST_TEST_EQ( v, 123456 ); + BOOST_TEST( string_to_unsigned( "1234567", v ) ) && BOOST_TEST_EQ( v, 1234567 ); + BOOST_TEST( string_to_unsigned( "12345678", v ) ) && BOOST_TEST_EQ( v, 12345678 ); + BOOST_TEST( string_to_unsigned( "123456789", v ) ) && BOOST_TEST_EQ( v, 123456789 ); + BOOST_TEST( string_to_unsigned( "1234567890", v ) ) && BOOST_TEST_EQ( v, 1234567890 ); + BOOST_TEST_NOT( string_to_unsigned( "12345678901", v ) ) && BOOST_TEST_EQ( v, 1234567890 ); + BOOST_TEST_NOT( string_to_unsigned( "123456789012", v ) ) && BOOST_TEST_EQ( v, 1234567890 ); + + BOOST_TEST( string_to_unsigned( "4294967295", v ) ) && BOOST_TEST_EQ( v, 4294967295 ); + BOOST_TEST_NOT( string_to_unsigned( "4294967296", v ) ) && BOOST_TEST_EQ( v, 429496729 ); + + BOOST_TEST( string_to_unsigned( "01", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST( string_to_unsigned( "001", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST( string_to_unsigned( "0001", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST( string_to_unsigned( "00001", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST( string_to_unsigned( "000001", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST( string_to_unsigned( "0000001", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST( string_to_unsigned( "00000001", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST( string_to_unsigned( "000000001", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST( string_to_unsigned( "0000000001", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST( string_to_unsigned( "00000000001", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST( string_to_unsigned( "000000000001", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST( string_to_unsigned( "0000000000001", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST( string_to_unsigned( "00000000000001", v ) ) && BOOST_TEST_EQ( v, 1 ); + + BOOST_TEST_NOT( string_to_unsigned( "1a", v ) ) && BOOST_TEST_EQ( v, 1 ); + BOOST_TEST_NOT( string_to_unsigned( "2 ", v ) ) && BOOST_TEST_EQ( v, 2 ); + + return boost::report_errors(); +} From f1003a9a5f895d38b3e0a9a21aeb4afa29423885 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 14 Oct 2023 03:25:40 +0300 Subject: [PATCH 17/80] Remove dependency on LexicalCast --- src/pthread/thread.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index 692b1787a1..d8d3fad4a1 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -34,8 +34,6 @@ #include #endif -#include - #include #include #include @@ -548,12 +546,22 @@ namespace boost value = thread_detail::string_trim( value ); if (key == physical_id) { - current_core_entry.first = boost::lexical_cast(value); + + if( !thread_detail::string_to_unsigned( value, current_core_entry.first ) ) + { + return hardware_concurrency(); + } + continue; } if (key == core_id) { - current_core_entry.second = boost::lexical_cast(value); + + if( !thread_detail::string_to_unsigned( value, current_core_entry.second ) ) + { + return hardware_concurrency(); + } + cores.insert(current_core_entry); continue; } From 527a56f2421a311319af34fe13bae869a86cfb11 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 14 Oct 2023 03:52:02 +0300 Subject: [PATCH 18/80] Remove dependency on Iterator --- include/boost/thread/future.hpp | 1 - include/boost/thread/futures/wait_for_any.hpp | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/thread/future.hpp b/include/boost/thread/future.hpp index bbf0ffc809..00f504b9b8 100644 --- a/include/boost/thread/future.hpp +++ b/include/boost/thread/future.hpp @@ -63,7 +63,6 @@ struct shared_state_base { #include #include #include -#include #include #include #include diff --git a/include/boost/thread/futures/wait_for_any.hpp b/include/boost/thread/futures/wait_for_any.hpp index 68ec065618..3f5d7b0555 100644 --- a/include/boost/thread/futures/wait_for_any.hpp +++ b/include/boost/thread/futures/wait_for_any.hpp @@ -17,7 +17,6 @@ #include #include -#include #include #include @@ -155,7 +154,9 @@ namespace boost { waiter.add(*current); } - return boost::next(begin, waiter.wait()); + + std::advance( begin, waiter.wait() ); + return begin; } } From 9d73a06e06c4372e7b7ca25ccc7235bdb61a2592 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 14 Oct 2023 04:12:09 +0300 Subject: [PATCH 19/80] Add missing include --- src/pthread/thread.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index d8d3fad4a1..bcaa787071 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef __GLIBC__ #include From 54a28e4d54f7956b03d5314790e077c2dbf063e6 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 14 Oct 2023 18:51:29 +0300 Subject: [PATCH 20/80] Remove MinGW (non w64) from Appveyor --- appveyor.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 091a2e6620..767e6ed929 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,11 +42,6 @@ environment: TOOLSET: gcc VARIANT: release - - ADDPATH: C:\mingw\bin; - TOOLSET: gcc - CXXSTD: 11 - VARIANT: debug - - ADDPATH: C:\cygwin64\bin; TOOLSET: gcc VARIANT: debug @@ -57,7 +52,7 @@ environment: - ADDPATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin; TOOLSET: gcc - VARIANT: debug,release + VARIANT: release install: - set GIT_FETCH_JOBS=8 From aec18d337f41d8e3081ee65f5cf3b5090179ab0e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 15 Oct 2023 16:17:36 +0300 Subject: [PATCH 21/80] Update CMakeLists.txt --- CMakeLists.txt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d724ea36a2..d0507d4677 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ # Generated by `boostdep --cmake thread` -# Copyright 2020 Peter Dimov +# Copyright 2020, 2021 Peter Dimov # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt -cmake_minimum_required(VERSION 3.5...3.16) +cmake_minimum_required(VERSION 3.8...3.20) project(boost_thread VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) @@ -63,9 +63,7 @@ target_link_libraries(boost_thread Boost::date_time Boost::exception Boost::function - Boost::intrusive Boost::io - Boost::iterator Boost::move Boost::optional Boost::predef @@ -80,12 +78,10 @@ target_link_libraries(boost_thread Boost::winapi Threads::Threads - - PRIVATE - Boost::algorithm - Boost::lexical_cast ) +target_compile_features(boost_thread PUBLIC cxx_std_11) + target_compile_definitions(boost_thread PUBLIC BOOST_THREAD_NO_LIB PRIVATE BOOST_THREAD_SOURCE @@ -102,4 +98,3 @@ if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") add_subdirectory(test) endif() - From 8811487643d9a89c01135304704dec556c646881 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Sun, 4 Feb 2024 13:03:02 +0100 Subject: [PATCH 22/80] Use forward slashes to separate include files We use automatic dependency tracking for #includes, and wrl includes have to be tracked differently whenever we are cross-compiling the code. This PR unifies such tracking. Forward slashes work just fine on Windows. --- src/win32/thread.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/win32/thread.cpp b/src/win32/thread.cpp index 000ab8779d..45c2651fbf 100644 --- a/src/win32/thread.cpp +++ b/src/win32/thread.cpp @@ -34,10 +34,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #pragma comment(lib, "runtimeobject.lib") #endif From e2de5713599cfdc6090327a507ec093280ec8a65 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 11 Mar 2024 08:38:17 -0500 Subject: [PATCH 23/80] Make the library modular usable. --- build.jam | 49 ++++++++++++++++++++++++++++++++++++++++++++++ build/Jamfile.v2 | 17 ++++++++++------ example/Jamfile.v2 | 2 +- test/Jamfile.v2 | 5 ++--- 4 files changed, 63 insertions(+), 10 deletions(-) create mode 100644 build.jam diff --git a/build.jam b/build.jam new file mode 100644 index 0000000000..9844c0d25e --- /dev/null +++ b/build.jam @@ -0,0 +1,49 @@ +# Copyright René Ferdinand Rivera Morell 2023 +# 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) + +import project ; + +project /boost/thread + : common-requirements + /boost/algorithm//boost_algorithm + /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/intrusive//boost_intrusive + /boost/io//boost_io + /boost/iterator//boost_iterator + /boost/lexical_cast//boost_lexical_cast + /boost/move//boost_move + /boost/optional//boost_optional + /boost/predef//boost_predef + /boost/preprocessor//boost_preprocessor + /boost/smart_ptr//boost_smart_ptr + /boost/static_assert//boost_static_assert + /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 + include + ; + +explicit + [ alias boost_thread : build//boost_thread ] + [ alias all : boost_thread example test ] + ; + +call-if : boost-library thread + : install boost_thread + ; diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 1a88d01020..9ef96f5c7c 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -40,14 +40,14 @@ import threadapi-feature ; exe has_atomic_flag_lockfree : ../build/has_atomic_flag_lockfree_test.cpp ; -project boost/thread +project : source-location ../src : requirements multi #static:BOOST_THREAD_STATIC_LINK=1 #shared:BOOST_THREAD_DYN_LINK=1 static:BOOST_THREAD_BUILD_LIB=1 shared:BOOST_THREAD_BUILD_DLL=1 - -@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag + -@%boostcpp.tag @$(__name__).tag gcc:-Wno-long-long #BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED @@ -156,8 +156,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 * ) @@ -315,5 +322,3 @@ lib boost_thread static:BOOST_THREAD_USE_LIB=1 @usage-requirements ; - -boost-install boost_thread ; \ No newline at end of file diff --git a/example/Jamfile.v2 b/example/Jamfile.v2 index bfc8a59b3c..fbdf760c50 100644 --- a/example/Jamfile.v2 +++ b/example/Jamfile.v2 @@ -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 ../build//boost_thread multi ; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 3f81bc07e8..9926be5ec1 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -268,10 +268,9 @@ 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) "/" "-" ] ; From 691b64d5aa9bf61306deb64017582e5130b7daeb Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 17 Mar 2024 18:34:13 -0500 Subject: [PATCH 24/80] Put back removing qualified boostcpp tag. As we need it until the Jamroot removes the qualified tag. --- build/Jamfile.v2 | 1 + 1 file changed, 1 insertion(+) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 9ef96f5c7c..1484366880 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -48,6 +48,7 @@ project static:BOOST_THREAD_BUILD_LIB=1 shared:BOOST_THREAD_BUILD_DLL=1 -@%boostcpp.tag + -@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag @$(__name__).tag gcc:-Wno-long-long #BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED From 43bfe9cbd2c50c01c5a7b8f464a6e40a240b7d23 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 29 Mar 2024 21:16:00 -0500 Subject: [PATCH 25/80] Switch to library requirements instead of source. As source puts extra source in install targets. --- build.jam | 58 +++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/build.jam b/build.jam index 9844c0d25e..56cae078e7 100644 --- a/build.jam +++ b/build.jam @@ -7,35 +7,35 @@ import project ; project /boost/thread : common-requirements - /boost/algorithm//boost_algorithm - /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/intrusive//boost_intrusive - /boost/io//boost_io - /boost/iterator//boost_iterator - /boost/lexical_cast//boost_lexical_cast - /boost/move//boost_move - /boost/optional//boost_optional - /boost/predef//boost_predef - /boost/preprocessor//boost_preprocessor - /boost/smart_ptr//boost_smart_ptr - /boost/static_assert//boost_static_assert - /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 + /boost/algorithm//boost_algorithm + /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/intrusive//boost_intrusive + /boost/io//boost_io + /boost/iterator//boost_iterator + /boost/lexical_cast//boost_lexical_cast + /boost/move//boost_move + /boost/optional//boost_optional + /boost/predef//boost_predef + /boost/preprocessor//boost_preprocessor + /boost/smart_ptr//boost_smart_ptr + /boost/static_assert//boost_static_assert + /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 include ; From ca4b54f96cfbcaea62f6bca0fa031a95632ac784 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 28 Apr 2024 20:17:11 -0500 Subject: [PATCH 26/80] Add missing NO_LIB usage requirements. --- build/Jamfile.v2 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 1484366880..19fb4745aa 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -35,7 +35,7 @@ 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 ; @@ -140,6 +140,7 @@ project #BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED #BOOST_SYSTEM_NO_DEPRECATED #BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS + BOOST_THREAD_NO_LIB=1 ; rule tag ( name : type ? : property-set ) @@ -277,10 +278,10 @@ rule requirements ( properties * ) } } result += BOOST_THREAD_DONT_USE_CHRONO ; - if ! [ configure.builds has_atomic_flag_lockfree - : $(properties) : "lockfree boost::atomic_flag" ] { - result += /boost/atomic//boost_atomic ; - } + if ! [ configure.builds has_atomic_flag_lockfree + : $(properties) : "lockfree boost::atomic_flag" ] { + result += /boost/atomic//boost_atomic ; + } } else { if win32 in $(properties) { From 0a8c93842e632cd53b144d7bb5ec4a0aca5db725 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Tue, 30 Apr 2024 00:14:56 -0700 Subject: [PATCH 27/80] fix: modify pthread_helpers adding missing assert header --- include/boost/thread/pthread/pthread_helpers.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/thread/pthread/pthread_helpers.hpp b/include/boost/thread/pthread/pthread_helpers.hpp index 6809994165..f3447d1fc2 100644 --- a/include/boost/thread/pthread/pthread_helpers.hpp +++ b/include/boost/thread/pthread/pthread_helpers.hpp @@ -9,6 +9,7 @@ #include #include +#include #include #include From 435a623e48d0d5b63b64356289ca4ab48dddfd1b Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 5 May 2024 09:00:01 -0500 Subject: [PATCH 28/80] Add requires-b2 check to top-level build file. --- build.jam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.jam b/build.jam index 56cae078e7..a86a032bde 100644 --- a/build.jam +++ b/build.jam @@ -3,6 +3,8 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) +require-b2 5.1 ; + import project ; project /boost/thread From 0fc00ec05c0cf739498a7515372e62d86199e060 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 13 May 2024 21:47:48 -0500 Subject: [PATCH 29/80] Update dependencies. --- build.jam | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build.jam b/build.jam index a86a032bde..7bf7159838 100644 --- a/build.jam +++ b/build.jam @@ -9,7 +9,6 @@ import project ; project /boost/thread : common-requirements - /boost/algorithm//boost_algorithm /boost/assert//boost_assert /boost/atomic//boost_atomic /boost/bind//boost_bind @@ -22,10 +21,7 @@ project /boost/thread /boost/date_time//boost_date_time /boost/exception//boost_exception /boost/function//boost_function - /boost/intrusive//boost_intrusive /boost/io//boost_io - /boost/iterator//boost_iterator - /boost/lexical_cast//boost_lexical_cast /boost/move//boost_move /boost/optional//boost_optional /boost/predef//boost_predef From e6e4e53807e834a9d120aba8131c1686ea32582f Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 14 Jun 2024 11:33:56 -0500 Subject: [PATCH 30/80] Bump B2 require to 5.2 --- build.jam | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build.jam b/build.jam index 7bf7159838..5494ea5556 100644 --- a/build.jam +++ b/build.jam @@ -3,9 +3,7 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -require-b2 5.1 ; - -import project ; +require-b2 5.2 ; project /boost/thread : common-requirements From b1ff784e5128d22698d5b1203f6db49d5f8182f0 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 20 Jul 2024 22:52:03 -0500 Subject: [PATCH 31/80] Update copyright dates. --- build.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.jam b/build.jam index 5494ea5556..6f6a6be1bb 100644 --- a/build.jam +++ b/build.jam @@ -1,4 +1,4 @@ -# Copyright René Ferdinand Rivera Morell 2023 +# 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) From 82aa252a9ee96ff961b6d136be1ffe6e54557bd0 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 23 Jul 2024 22:34:22 -0500 Subject: [PATCH 32/80] Move inter-lib dependencies to a project variable and into the build targets. --- build.jam | 53 +++++++++++++++++++++++++----------------------- build/Jamfile.v2 | 1 + 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/build.jam b/build.jam index 6f6a6be1bb..f42443c0e7 100644 --- a/build.jam +++ b/build.jam @@ -5,33 +5,35 @@ 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/static_assert//boost_static_assert + /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 : common-requirements - /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/static_assert//boost_static_assert - /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 include ; @@ -43,3 +45,4 @@ explicit call-if : boost-library thread : install boost_thread ; + diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 19fb4745aa..2ec45b8e45 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -42,6 +42,7 @@ exe has_atomic_flag_lockfree : ../build/has_atomic_flag_lockfree_test.cpp ; project : source-location ../src + : common-requirements $(boost_dependencies) : requirements multi #static:BOOST_THREAD_STATIC_LINK=1 #shared:BOOST_THREAD_DYN_LINK=1 From 814ed9f34168043d5780748d44e90bdfac696ccc Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 9 Aug 2024 22:26:06 -0500 Subject: [PATCH 33/80] Update build deps. --- test/Jamfile.v2 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 9926be5ec1..340f6c0aa7 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -275,8 +275,8 @@ rule generate_self_contained_header_tests # 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 : "BOOST_THREAD_TEST_HEADER=$(rel_file)" $(file) : $(test_name) ] ; - all_rules += [ compile self_contained_header.cpp : "BOOST_THREAD_TEST_HEADER=$(rel_file)" "BOOST_THREAD_TEST_POST_WINDOWS_H" $(file) @windows-cygwin-specific : $(test_name)-post_winh ] ; + all_rules += [ compile self_contained_header.cpp : "BOOST_THREAD_TEST_HEADER=$(rel_file)" $(file) ../build//boost_thread : $(test_name) ] ; + all_rules += [ compile self_contained_header.cpp : "BOOST_THREAD_TEST_HEADER=$(rel_file)" "BOOST_THREAD_TEST_POST_WINDOWS_H" $(file) @windows-cygwin-specific ../build//boost_thread : $(test_name)-post_winh ] ; } } @@ -1011,7 +1011,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 : @@ -1032,13 +1032,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 : @@ -1049,7 +1049,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 ] @@ -1059,7 +1059,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 ; From 49ccf9c30a0ca556873dbf64b12b0d741d1b3e66 Mon Sep 17 00:00:00 2001 From: Arvid Norlander Date: Fri, 8 Nov 2024 16:48:43 +0100 Subject: [PATCH 34/80] Fix build on clang-19 (which checks more things in uninstantiated templates) Fixes issue #402 --- include/boost/thread/future.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/thread/future.hpp b/include/boost/thread/future.hpp index 00f504b9b8..d15d7ffa54 100644 --- a/include/boost/thread/future.hpp +++ b/include/boost/thread/future.hpp @@ -4668,7 +4668,7 @@ namespace detail } run_it& operator=(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT { if (this != &x) { - that_=x.that; + that_=x.that_; x.that_.reset(); } return *this; From 76411e59181eafd5ea592fd1fa527cd3461808b3 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 15 Dec 2024 20:15:24 +0200 Subject: [PATCH 35/80] Update ci.yml --- .github/workflows/ci.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed2fa9db77..83dcf66969 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,14 +18,14 @@ jobs: matrix: include: - toolset: gcc-4.8 - os: ubuntu-latest - container: ubuntu:18.04 cxxstd: 11 + container: ubuntu:18.04 + os: ubuntu-latest install: g++-4.8 - toolset: gcc-5 cxxstd: 11 - os: ubuntu-latest container: ubuntu:18.04 + os: ubuntu-latest install: g++-5 - toolset: gcc-7 os: ubuntu-20.04 @@ -34,19 +34,23 @@ jobs: os: ubuntu-20.04 - toolset: gcc-11 os: ubuntu-22.04 + - toolset: gcc-13 + os: ubuntu-24.04 + - toolset: clang + os: ubuntu-20.04 - toolset: clang - compiler: clang++-15 - cxxstd: 20 os: ubuntu-22.04 - install: clang-15 - toolset: clang - os: macos-11 + cxxstd: 20 + os: ubuntu-24.04 + - toolset: clang + os: macos-13 cxxstd: 11 - toolset: clang - os: macos-12 + os: macos-14 cxxstd: 14 - toolset: clang - os: macos-13 + os: macos-15 cxxstd: 17 runs-on: ${{matrix.os}} From 48482ff6961e986360047f800b3979f3742453ba Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 15 Dec 2024 20:32:32 +0200 Subject: [PATCH 36/80] Apply Node20 workaround --- .github/workflows/ci.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83dcf66969..c07d997862 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,20 +54,32 @@ jobs: cxxstd: 17 runs-on: ${{matrix.os}} - container: ${{matrix.container}} + + container: + image: ${{matrix.container}} + volumes: + - /node20217:/node20217:rw,rshared + - ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }} defaults: run: shell: bash steps: - - uses: actions/checkout@v3 - - name: Setup container environment if: matrix.container run: | apt-get update - apt-get -y install sudo python3 git g++ + apt-get -y install sudo python3 git g++ curl xz-utils + + - name: Install nodejs20glibc2.17 + if: ${{ startsWith( matrix.container, 'ubuntu:1' ) }} + run: | + curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz + tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217 + ldd /__e/node20/bin/node + + - uses: actions/checkout@v4 - name: Install packages if: matrix.install From b3183638cbd117a6a0ecee57ac4679564053edea Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 12 Mar 2025 03:12:54 +0200 Subject: [PATCH 37/80] Update ci.yml --- .github/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c07d997862..a95d0c6251 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,16 +28,19 @@ jobs: os: ubuntu-latest install: g++-5 - toolset: gcc-7 - os: ubuntu-20.04 - install: g++-7 + container: ubuntu:18.04 + os: ubuntu-latest - toolset: gcc-9 - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest - toolset: gcc-11 os: ubuntu-22.04 - toolset: gcc-13 os: ubuntu-24.04 - toolset: clang - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest + install: clang - toolset: clang os: ubuntu-22.04 - toolset: clang From 28d58852bb8b638dc3e82fe06002e06312f4ea83 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 14 Apr 2025 20:26:31 -0500 Subject: [PATCH 38/80] Move the include usage req to the library build target. --- build.jam | 2 -- build/Jamfile.v2 | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.jam b/build.jam index f42443c0e7..d0caf573dc 100644 --- a/build.jam +++ b/build.jam @@ -33,8 +33,6 @@ constant boost_dependencies : /boost/winapi//boost_winapi ; project /boost/thread - : common-requirements - include ; explicit diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 2ec45b8e45..5be59046a3 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -42,7 +42,9 @@ exe has_atomic_flag_lockfree : ../build/has_atomic_flag_lockfree_test.cpp ; project : source-location ../src - : common-requirements $(boost_dependencies) + : common-requirements + $(boost_dependencies) + ../include : requirements multi #static:BOOST_THREAD_STATIC_LINK=1 #shared:BOOST_THREAD_DYN_LINK=1 From ca6b6affecfd66c04bf53019c817768135a3081c Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 22 Jan 2026 19:47:42 +0300 Subject: [PATCH 39/80] Remove dependencies on Boost.StaticAssert. Boost.StaticAssert has been merged into Boost.Config, so remove the dependency. --- CMakeLists.txt | 1 - build.jam | 1 - 2 files changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0507d4677..d13a693aa6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/build.jam b/build.jam index d0caf573dc..7cb3cb926a 100644 --- a/build.jam +++ b/build.jam @@ -24,7 +24,6 @@ constant boost_dependencies : /boost/predef//boost_predef /boost/preprocessor//boost_preprocessor /boost/smart_ptr//boost_smart_ptr - /boost/static_assert//boost_static_assert /boost/system//boost_system /boost/throw_exception//boost_throw_exception /boost/tuple//boost_tuple From ed7171099bf5e7483cb727baa1afd727e912ed06 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 6 Feb 2026 14:33:34 +0300 Subject: [PATCH 40/80] Silence MSVC warning about unreferenced formal parameter. Closes https://github.com/boostorg/thread/pull/382. --- src/win32/thread.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/win32/thread.cpp b/src/win32/thread.cpp index 45c2651fbf..fd49f17bac 100644 --- a/src/win32/thread.cpp +++ b/src/win32/thread.cpp @@ -577,10 +577,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 From 3d95d2366e12b018c2dc121c84611f3d4fd7823b Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 6 Feb 2026 14:58:02 +0300 Subject: [PATCH 41/80] Optimize run_it construction/assignment from rvalue references. Also fix code indentation. --- include/boost/thread/future.hpp | 48 +++++++++++++++++---------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/include/boost/thread/future.hpp b/include/boost/thread/future.hpp index 6b6745bab4..154114aeb6 100644 --- a/include/boost/thread/future.hpp +++ b/include/boost/thread/future.hpp @@ -4649,32 +4649,34 @@ namespace detail shared_ptr 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; - } - // move - run_it(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT - : that_(x.that_) - { - x.that_.reset(); + 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_; } - 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 that) : that_(boost::move(that)) + {} +#else + run_it(shared_ptr that) : that_(that) + {} #endif - run_it(shared_ptr that) : that_ (that) {} void operator()() { From f19c0d3b5627bcaf1c6f974b45d676f68faee25c Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 6 Feb 2026 15:05:38 +0300 Subject: [PATCH 42/80] Removed usage of deprecated Boost.Test header. --- test/test_lock_concept.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_lock_concept.cpp b/test/test_lock_concept.cpp index 3b0cc2e2e6..ac113ab9d1 100644 --- a/test/test_lock_concept.cpp +++ b/test/test_lock_concept.cpp @@ -7,7 +7,6 @@ #define BOOST_TEST_MODULE Boost.Threads: lock_concept test suite #include -#include #include #include #include From de9eb0ee7df11a01c2716ee675123d376768ac48 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 6 Feb 2026 15:06:51 +0300 Subject: [PATCH 43/80] Fix signed/unsigned a mismatch warning. --- test/test_2741.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_2741.cpp b/test/test_2741.cpp index 258b4ecfc4..832a720c64 100644 --- a/test/test_2741.cpp +++ b/test/test_2741.cpp @@ -42,7 +42,7 @@ BOOST_AUTO_TEST_CASE(test_native_handle) BOOST_CHECK(!pthread_attr_setstacksize(h, MY_PTHREAD_STACK)); std::size_t res; BOOST_CHECK(!pthread_attr_getstacksize(h, &res)); - BOOST_CHECK(res >= (MY_PTHREAD_STACK)); + BOOST_CHECK(res >= static_cast(MY_PTHREAD_STACK)); #else #error "Boost thread unavailable on this platform" #endif From 6da5c6d418c97c19f7b38a2367b021c3d803ca4b Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 6 Feb 2026 15:08:13 +0300 Subject: [PATCH 44/80] Updated no_exceptions_support.hpp include to the up-to-date location. --- test/test_4882.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_4882.cpp b/test/test_4882.cpp index b1bb725395..1c0fa6ee92 100644 --- a/test/test_4882.cpp +++ b/test/test_4882.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include //#include boost::shared_mutex mutex; From 24917577d7dada9f652e4a2d5e6f499b25770c55 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 6 Feb 2026 15:14:21 +0300 Subject: [PATCH 45/80] Silence unused variable warnings. --- .../conditions/condition_variable/wait_for_pred_pass.cpp | 5 +++-- .../conditions/condition_variable/wait_until_pred_pass.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp b/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp index 8b03f35cf5..bfc5555f0b 100644 --- a/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp +++ b/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include "../../../timming.hpp" @@ -64,9 +65,9 @@ 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(); if (runs == 0) { assert(t1 - t0 < max_diff); diff --git a/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp b/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp index f4441ea4bd..a0eee6a679 100644 --- a/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp +++ b/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include "../../../timming.hpp" @@ -79,7 +80,7 @@ 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(); if (runs == 0) { From e2f6e8789f8e5093d977c6735413f57578fb342e Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 6 Feb 2026 15:21:11 +0300 Subject: [PATCH 46/80] Fixed uninitialized variable warnings. --- test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp | 4 ++-- test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp | 4 ++-- .../sync_bounded_queue/single_thread_pass.cpp | 4 ++-- test/sync/mutual_exclusion/sync_deque/single_thread_pass.cpp | 4 ++-- test/sync/mutual_exclusion/sync_queue/single_thread_pass.cpp | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp b/test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp index c373ed5946..fc801248e4 100644 --- a/test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp @@ -90,7 +90,7 @@ int main() // empty queue push lvalue/copyable succeeds boost::deque_adaptor > sq; boost::deque_back q(sq); - int i; + int i = 42; q.push(i); BOOST_TEST(! q.empty()); BOOST_TEST(! q.full()); @@ -140,7 +140,7 @@ int main() // empty queue push lvalue succeeds boost::deque_adaptor > sq; boost::deque_back q(sq); - int i; + int i = 42; q.push(i); BOOST_TEST(! q.empty()); BOOST_TEST(! q.full()); diff --git a/test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp b/test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp index b47a396e91..f730dae205 100644 --- a/test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp @@ -90,7 +90,7 @@ int main() // empty queue push lvalue/copyable succeeds boost::queue_adaptor > sq; boost::queue_back q(sq); - int i; + int i = 42; q.push(i); BOOST_TEST(! q.empty()); BOOST_TEST(! q.full()); @@ -141,7 +141,7 @@ int main() // empty queue push lvalue succeeds boost::queue_adaptor > sq; boost::queue_back q(sq); - int i; + int i = 42; q.push(i); BOOST_TEST(! q.empty()); BOOST_TEST(! q.full()); diff --git a/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp index 49b90fa5f5..ee8acc57fe 100644 --- a/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp @@ -103,7 +103,7 @@ int main() { // empty queue push value succeeds boost::sync_bounded_queue q(2); - int i; + int i = 42; q.push(i); BOOST_TEST(! q.empty()); BOOST_TEST(! q.full()); @@ -334,7 +334,7 @@ int main() { // empty queue push value succeeds boost::sync_bounded_queue q(2); - int i; + int i = 42; q.push_back(i); BOOST_TEST(! q.empty()); BOOST_TEST(! q.full()); diff --git a/test/sync/mutual_exclusion/sync_deque/single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_deque/single_thread_pass.cpp index 4cebae3c3b..dd3852925b 100644 --- a/test/sync/mutual_exclusion/sync_deque/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_deque/single_thread_pass.cpp @@ -68,7 +68,7 @@ int main() { // empty queue push lvalue/copyable succeeds boost::sync_deque q; - int i; + int i = 42; q.push_back(i); BOOST_TEST(! q.empty()); BOOST_TEST(! q.full()); @@ -111,7 +111,7 @@ int main() { // empty queue push lvalue succeeds boost::sync_deque q; - int i; + int i = 42; q.push_back(i); BOOST_TEST(! q.empty()); BOOST_TEST(! q.full()); diff --git a/test/sync/mutual_exclusion/sync_queue/single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_queue/single_thread_pass.cpp index 49445bbd62..da9b346fd3 100644 --- a/test/sync/mutual_exclusion/sync_queue/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_queue/single_thread_pass.cpp @@ -82,7 +82,7 @@ int main() { // empty queue push lvalue succeeds boost::sync_queue q; - int i; + int i = 42; q.push(i); BOOST_TEST(! q.empty()); BOOST_TEST(! q.full()); From ac15f907be14ce070a99d0c719aa8bcdb14de6b0 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 6 Feb 2026 15:45:40 +0300 Subject: [PATCH 47/80] Fix warnings about missing sized deallocation operator in C++14 mode. --- test/threads/thread/constr/FArgs_pass.cpp | 18 ++++++++++++++++++ test/threads/thread/constr/F_pass.cpp | 18 ++++++++++++++++++ test/threads/thread/constr/lambda_pass.cpp | 18 ++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/test/threads/thread/constr/FArgs_pass.cpp b/test/threads/thread/constr/FArgs_pass.cpp index cfee139082..6de724deff 100644 --- a/test/threads/thread/constr/FArgs_pass.cpp +++ b/test/threads/thread/constr/FArgs_pass.cpp @@ -18,10 +18,12 @@ // template thread(F f, Args... args); #include +#include #include #include #include #include +#include unsigned throw_one = 0xFFFF; @@ -51,6 +53,22 @@ void operator delete(void* p) BOOST_NOEXCEPT_OR_NOTHROW std::free(p); } +#if (defined(__cpp_sized_deallocation) && (__cpp_sized_deallocation >= 201309l)) || \ + (BOOST_CXX_VERSION > 201103l && \ + (defined(__GNUC__) && (__GNUC__ >= 5)) || \ + (defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))) || \ + (defined(BOOST_MSVC) && (_MSC_VER >= 1900)) \ + ) +#if defined BOOST_MSVC +void operator delete(void* p, std::size_t) +#else +void operator delete(void* p, std::size_t) BOOST_NOEXCEPT_OR_NOTHROW +#endif +{ + operator delete(p); +} +#endif + bool f_run = false; void f(int i, double j) diff --git a/test/threads/thread/constr/F_pass.cpp b/test/threads/thread/constr/F_pass.cpp index 43827226c6..ee405394b8 100644 --- a/test/threads/thread/constr/F_pass.cpp +++ b/test/threads/thread/constr/F_pass.cpp @@ -18,10 +18,12 @@ // template thread(F f, Args... args); #include +#include #include #include #include #include +#include unsigned throw_one = 0xFFFF; @@ -51,6 +53,22 @@ void operator delete(void* p) BOOST_NOEXCEPT_OR_NOTHROW std::free(p); } +#if (defined(__cpp_sized_deallocation) && (__cpp_sized_deallocation >= 201309l)) || \ + (BOOST_CXX_VERSION > 201103l && \ + (defined(__GNUC__) && (__GNUC__ >= 5)) || \ + (defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))) || \ + (defined(BOOST_MSVC) && (_MSC_VER >= 1900)) \ + ) +#if defined BOOST_MSVC +void operator delete(void* p, std::size_t) +#else +void operator delete(void* p, std::size_t) BOOST_NOEXCEPT_OR_NOTHROW +#endif +{ + operator delete(p); +} +#endif + bool f_run = false; void f() diff --git a/test/threads/thread/constr/lambda_pass.cpp b/test/threads/thread/constr/lambda_pass.cpp index 38742f53d3..d5af13f296 100644 --- a/test/threads/thread/constr/lambda_pass.cpp +++ b/test/threads/thread/constr/lambda_pass.cpp @@ -18,10 +18,12 @@ // template thread(Clousure f); #include +#include #include #include #include #include +#include #if ! defined BOOST_NO_CXX11_LAMBDAS @@ -51,6 +53,22 @@ void operator delete(void* p) BOOST_NOEXCEPT_OR_NOTHROW std::free(p); } +#if (defined(__cpp_sized_deallocation) && (__cpp_sized_deallocation >= 201309l)) || \ + (BOOST_CXX_VERSION > 201103l && \ + (defined(__GNUC__) && (__GNUC__ >= 5)) || \ + (defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))) || \ + (defined(BOOST_MSVC) && (_MSC_VER >= 1900)) \ + ) +#if defined BOOST_MSVC +void operator delete(void* p, std::size_t) +#else +void operator delete(void* p, std::size_t) BOOST_NOEXCEPT_OR_NOTHROW +#endif +{ + operator delete(p); +} +#endif + bool f_run = false; int main() From 072ee46e8a3c4217f82639df5153388914009b70 Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Tue, 16 Jun 2026 20:38:43 -0700 Subject: [PATCH 48/80] Use no-exceptions-friendly macros for try/catch block This fixes build breakages when -fno-exceptions is used --- src/pthread/thread.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index bcaa787071..ec98e1b370 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -515,7 +515,7 @@ namespace boost unsigned thread::physical_concurrency() BOOST_NOEXCEPT { #ifdef __linux__ - try { + BOOST_TRY { using namespace std; ifstream proc_cpuinfo ("/proc/cpuinfo"); @@ -570,9 +570,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(...) { + } BOOST_CATCH(...) { return hardware_concurrency(); } + BOOST_CATCH_END #elif defined(__APPLE__) int count; size_t size=sizeof(count); From 48929e4281278dea72c2db105cb1c12d1488cdbe Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Mon, 29 Jun 2026 13:13:29 +0300 Subject: [PATCH 49/80] Added missing includes of no_exceptions_support.hpp. --- src/pthread/thread.cpp | 1 + src/win32/thread.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index ec98e1b370..fbecf0bc5a 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #ifdef __GLIBC__ #include diff --git a/src/win32/thread.cpp b/src/win32/thread.cpp index fd49f17bac..996cb40be9 100644 --- a/src/win32/thread.cpp +++ b/src/win32/thread.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #if BOOST_PLAT_WINDOWS_RUNTIME #include From 375ba39cf9de80b1570f0a420e0d915604a57e05 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Mon, 29 Jun 2026 13:19:38 +0300 Subject: [PATCH 50/80] Fixed code indentation. --- src/pthread/thread.cpp | 88 +++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index fbecf0bc5a..9deef7a2fb 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -186,7 +186,7 @@ namespace boost // Unhandled exceptions still cause the application to terminate // BOOST_CATCH(...) // { -// throw; +// throw; // // std::terminate(); // } @@ -213,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() @@ -355,7 +356,7 @@ namespace boost } else { - return false; + return false; } } @@ -374,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; @@ -438,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(&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(&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 { @@ -572,7 +573,7 @@ namespace boost // /proc/cpuinfo is formatted differently than we expect. return cores.size() != 0 ? cores.size() : hardware_concurrency(); } BOOST_CATCH(...) { - return hardware_concurrency(); + return hardware_concurrency(); } BOOST_CATCH_END #elif defined(__APPLE__) @@ -788,26 +789,25 @@ namespace boost BOOST_THREAD_DECL void notify_all_at_thread_exit(condition_variable& cond, unique_lock 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 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 - } From 07a7ded8414b64f142f7e68b7b8a612237882310 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Tue, 30 Jun 2026 00:41:43 +0300 Subject: [PATCH 51/80] Reworked GitHub Actions CI config. Removed usage of actions/checkout which breaks for older compilers due to dependency on a new Node.js version. Use curl to download Boost sources. Removed obsolete GitHub Actions images, added new compilers and more C++ versions to test. Added jobs for more target operating systems. Updated environment setup scripts for better performance and reliability. --- .github/workflows/ci.yml | 1223 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 1162 insertions(+), 61 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a95d0c6251..024c707b31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,8 @@ +# Copyright 2026 Andrey Semashev +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) + name: CI on: @@ -8,117 +13,1213 @@ on: - develop - feature/** +concurrency: + group: ${{format('{0}:{1}', github.repository, github.ref)}} + cancel-in-progress: true + env: - UBSAN_OPTIONS: print_stacktrace=1 + GIT_FETCH_JOBS: 8 + NET_RETRY_COUNT: 5 + DEFAULT_BUILD_VARIANT: debug,release jobs: posix: + defaults: + run: + shell: bash + strategy: fail-fast: false matrix: include: + # Linux, gcc - toolset: gcc-4.8 - cxxstd: 11 + cxxstd: "11" + extra_tests: 1 + os: ubuntu-latest container: ubuntu:18.04 + install: + - g++-4.8 + - toolset: gcc-4.9 + cxxstd: "11" os: ubuntu-latest - install: g++-4.8 + container: ubuntu:16.04 + install: + - g++-4.9 - toolset: gcc-5 - cxxstd: 11 - container: ubuntu:18.04 + cxxstd: "11,14,1z" + os: ubuntu-latest + container: ubuntu:16.04 + install: + - g++-5 + - toolset: gcc-6 + cxxstd: "11,14,1z" os: ubuntu-latest - install: g++-5 + container: ubuntu:18.04 + install: + - g++-6 - toolset: gcc-7 + cxxstd: "11,14,17" + os: ubuntu-latest container: ubuntu:18.04 + install: + - g++-7 + - toolset: gcc-8 + cxxstd: "14,17,2a" os: ubuntu-latest + container: ubuntu:18.04 + install: + - g++-8 - toolset: gcc-9 + cxxstd: "14,17,2a" + os: ubuntu-latest + container: ubuntu:20.04 + install: + - g++-9 + - toolset: gcc-10 + cxxstd: "14,17,20" + os: ubuntu-latest container: ubuntu:20.04 + install: + - g++-10 + - toolset: gcc-11 + cxxstd: "14-gnu,17-gnu" os: ubuntu-latest + container: ubuntu:22.04 + install: + - g++-11 - toolset: gcc-11 - os: ubuntu-22.04 + cxxstd: "20-gnu,23-gnu" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - g++-11 + - toolset: gcc-12 + cxxstd: "14-gnu,17-gnu" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - g++-12 + - toolset: gcc-12 + cxxstd: "20-gnu,23-gnu" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - g++-12 - toolset: gcc-13 + cxxstd: "14-gnu,17-gnu" + os: ubuntu-24.04 + install: + - g++-13 + - toolset: gcc-13 + cxxstd: "20-gnu,23-gnu" + os: ubuntu-24.04 + install: + - g++-13 + - toolset: gcc-14 + cxxstd: "14-gnu,17-gnu,20-gnu" os: ubuntu-24.04 + install: + - g++-14 + - toolset: gcc-14 + cxxstd: "23-gnu,26-gnu" + os: ubuntu-24.04 + install: + - g++-14 + - toolset: gcc-15 + cxxstd: "14-gnu,17-gnu,20-gnu" + os: ubuntu-26.04 + install: + - g++-15 + - toolset: gcc-15 + cxxstd: "23-gnu,26-gnu" + os: ubuntu-26.04 + install: + - g++-15 + - toolset: gcc-16 + cxxstd: "14-gnu,17-gnu,20-gnu" + os: ubuntu-26.04 + install: + - g++-16 + - toolset: gcc-16 + cxxstd: "23-gnu,26-gnu" + os: ubuntu-26.04 + install: + - g++-16 + - name: UBSAN + toolset: gcc-15 + cxxstd: "14-gnu,17-gnu,20-gnu,23-gnu,26-gnu" + ubsan: 1 + build_variant: debug + os: ubuntu-26.04 + install: + - g++-15 + + # Linux, clang + - toolset: clang + compiler: clang++-3.7 + cxxstd: "11,14" + os: ubuntu-latest + container: ubuntu:16.04 + install: + - clang-3.7 + - toolset: clang + compiler: clang++-3.8 + cxxstd: "11,14" + os: ubuntu-latest + container: ubuntu:16.04 + install: + - clang-3.8 + - toolset: clang + compiler: clang++-3.9 + cxxstd: "11,14" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-3.9 + - toolset: clang + compiler: clang++-4.0 + cxxstd: "11,14" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-4.0 + - toolset: clang + compiler: clang++-5.0 + cxxstd: "14,1z" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-5.0 + - toolset: clang + compiler: clang++-6.0 + cxxstd: "14,17" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-6.0 + - toolset: clang + compiler: clang++-7 + cxxstd: "14,17" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-7 + # Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode - toolset: clang + compiler: clang++-8 + cxxstd: "14,17,2a" + os: ubuntu-latest + container: ubuntu:18.04 + install: + - clang-8 + - g++-7 + gcc_toolchain: 7 + - toolset: clang + compiler: clang++-9 + cxxstd: "14,17,2a" + os: ubuntu-latest container: ubuntu:20.04 + install: + - clang-9 + - toolset: clang + compiler: clang++-10 + cxxstd: "14,17,20" + os: ubuntu-latest + container: ubuntu:20.04 + install: + - clang-10 + - toolset: clang + compiler: clang++-11 + cxxstd: "14,17,20" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-11 + - g++-11 + gcc_toolchain: 11 + - toolset: clang + compiler: clang++-12 + cxxstd: "17-gnu,20-gnu,2b-gnu" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-12 + - g++-11 + gcc_toolchain: 11 + - toolset: clang + compiler: clang++-13 + cxxstd: "17-gnu,20-gnu,2b-gnu" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-13 + - g++-11 + gcc_toolchain: 11 + - toolset: clang + compiler: clang++-14 + cxxstd: "17-gnu,20-gnu,2b-gnu" os: ubuntu-latest - install: clang + container: ubuntu:22.04 + install: + - clang-14 + - g++-11 + gcc_toolchain: 11 - toolset: clang - os: ubuntu-22.04 + compiler: clang++-15 + cxxstd: "17-gnu,20-gnu,2b-gnu" + os: ubuntu-latest + container: ubuntu:22.04 + install: + - clang-15 + - g++-11 + gcc_toolchain: 11 + - toolset: clang + compiler: clang++-16 + cxxstd: "17-gnu,20-gnu,2b-gnu" + os: ubuntu-24.04 + install: + - clang-16 + - g++-11 + gcc_toolchain: 11 - toolset: clang - cxxstd: 20 + compiler: clang++-17 + cxxstd: "17-gnu,20-gnu,23-gnu" os: ubuntu-24.04 + install: + - clang-17 + - g++-11 + gcc_toolchain: 11 - toolset: clang - os: macos-13 - cxxstd: 11 + compiler: clang++-18 + cxxstd: "17-gnu,20-gnu" + os: ubuntu-24.04 + install: + - clang-18 + - g++-13 + - toolset: clang + compiler: clang++-18 + cxxstd: "23-gnu,26-gnu" + os: ubuntu-24.04 + install: + - clang-18 + - g++-13 + - toolset: clang + compiler: clang++-19 + cxxstd: "17-gnu,20-gnu" + os: ubuntu-24.04 + install: + - clang-19 + - toolset: clang + compiler: clang++-19 + cxxstd: "23-gnu,26-gnu" + os: ubuntu-24.04 + install: + - clang-19 + - toolset: clang + compiler: clang++-20 + cxxstd: "17-gnu,20-gnu" + os: ubuntu-26.04 + install: + - clang-20 + - toolset: clang + compiler: clang++-20 + cxxstd: "23-gnu,26-gnu" + os: ubuntu-26.04 + install: + - clang-20 + - toolset: clang + compiler: clang++-21 + cxxstd: "17-gnu,20-gnu" + os: ubuntu-26.04 + install: + - clang-21 + - toolset: clang + compiler: clang++-21 + cxxstd: "23-gnu,26-gnu" + os: ubuntu-26.04 + install: + - clang-21 + - toolset: clang + compiler: clang++-22 + cxxstd: "17-gnu,20-gnu" + os: ubuntu-26.04 + install: + - clang-22 + - toolset: clang + compiler: clang++-22 + cxxstd: "23-gnu,26-gnu" + os: ubuntu-26.04 + install: + - clang-22 + - toolset: clang + compiler: clang++-22 + cxxstd: "11-gnu,14-gnu" + cxxflags: -stdlib=libc++ + linkflags: -stdlib=libc++ + extra_tests: 1 + os: ubuntu-26.04 + install: + - clang-22 + - libc++-22-dev + - libc++abi-22-dev + - toolset: clang + compiler: clang++-22 + cxxstd: "17-gnu,20-gnu" + cxxflags: -stdlib=libc++ + linkflags: -stdlib=libc++ + os: ubuntu-26.04 + install: + - clang-22 + - libc++-22-dev + - libc++abi-22-dev + - toolset: clang + compiler: clang++-22 + cxxstd: "23-gnu,26-gnu" + cxxflags: -stdlib=libc++ + linkflags: -stdlib=libc++ + os: ubuntu-26.04 + install: + - clang-22 + - libc++-22-dev + - libc++abi-22-dev + - name: UBSAN + toolset: clang + compiler: clang++-22 + cxxstd: "17-gnu,20-gnu,23-gnu,26-gnu" + cxxflags: -stdlib=libc++ + linkflags: "-stdlib=libc++ -lubsan" + ubsan: 1 + build_variant: debug + os: ubuntu-26.04 + install: + - clang-22 + - libc++-22-dev + - libc++abi-22-dev + + - toolset: clang + vm: freebsd + version: "14.3" + cxxstd: "11,14" + extra_tests: 1 + build_variant: debug + os: ubuntu-latest + - toolset: clang + vm: freebsd + version: "14.3" + cxxstd: "17,20,23,26" + build_variant: debug + os: ubuntu-latest + + - toolset: clang + vm: openbsd + version: "7.7" + cxxstd: "11,14" + extra_tests: 1 + build_variant: debug + os: ubuntu-latest + - toolset: clang + vm: openbsd + version: "7.7" + cxxstd: "17,20,2b" + build_variant: debug + os: ubuntu-latest + + - toolset: gcc + vm: netbsd + version: "10.1" + cxxstd: "11" + extra_tests: 1 + build_variant: debug + os: ubuntu-latest + - toolset: gcc + vm: netbsd + version: "10.1" + cxxstd: "14,17,20" + build_variant: debug + os: ubuntu-latest + + - toolset: gcc + vm: dragonflybsd + version: "6.4.0" + cxxstd: "11" + extra_tests: 1 + build_variant: debug + os: ubuntu-latest + lang: en_US.UTF-8 + - toolset: gcc + vm: dragonflybsd + version: "6.4.0" + cxxstd: "14,17,2a" + build_variant: debug + os: ubuntu-latest + lang: en_US.UTF-8 + + - toolset: gcc + vm: solaris + version: "11.4-gcc" + cxxstd: "11,14" + cxxflags: -D__SunOS_5_11 + extra_tests: 1 + build_variant: debug + os: ubuntu-latest + - toolset: gcc + vm: solaris + version: "11.4-gcc" + cxxstd: "17,20,23,26" + cxxflags: -D__SunOS_5_11 + build_variant: debug + os: ubuntu-latest + + - toolset: gcc + vm: omnios + version: "r151056-build" + cxxstd: "11,14" + extra_tests: 1 + build_variant: debug + os: ubuntu-latest + - toolset: gcc + vm: omnios + version: "r151056-build" + cxxstd: "17,20" + build_variant: debug + os: ubuntu-latest + - toolset: gcc + vm: omnios + version: "r151056-build" + cxxstd: "23,26" + build_variant: debug + os: ubuntu-latest + + - toolset: gcc + vm: openindiana + version: "202510-build" + cxxstd: "11,14" + extra_tests: 1 + build_variant: debug + os: ubuntu-latest + - toolset: gcc + vm: openindiana + version: "202510-build" + cxxstd: "17,20" + build_variant: debug + os: ubuntu-latest + - toolset: gcc + vm: openindiana + version: "202510-build" + cxxstd: "23,26" + build_variant: debug + os: ubuntu-latest + + - toolset: clang + os: macos-14 + cxxstd: "11" + extra_tests: 1 + build_variant: debug - toolset: clang os: macos-14 - cxxstd: 14 + cxxstd: "14,17,20,2b" + build_variant: debug - toolset: clang os: macos-15 - cxxstd: 17 + cxxstd: "14,17,20,23,26" + build_variant: debug + - toolset: clang + os: macos-26 + cxxstd: "14,17,20,23,26" + build_variant: debug + timeout-minutes: 150 runs-on: ${{matrix.os}} + container: ${{matrix.container}} - container: - image: ${{matrix.container}} - volumes: - - /node20217:/node20217:rw,rshared - - ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }} + steps: + - name: Setup environment + run: | + if [ -n "${{matrix.lang}}" ] + then + echo "LANG=${{matrix.lang}}" >> $GITHUB_ENV + export LANG=${{matrix.lang}} + fi + if [ -f "/etc/debian_version" ] + then + echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV + export DEBIAN_FRONTEND=noninteractive + fi + if [ -n "${{matrix.container}}" ] + then + echo "GHA_CONTAINER=${{matrix.container}}" >> $GITHUB_ENV + if [ -f "/etc/debian_version" ] + then + # Use Azure APT mirrors in containers to avoid HTTP errors due to DDoS filters triggered by lots of CI jobs launching concurrently. + # Note that not all Ubuntu versions support "mirror+file:..." URIs in APT sources, so just use Azure mirrors exclusively. + # Note also that on recent Ubuntu versions DEB822 format is used for source files. + APT_SOURCES=() + if [ -d "/etc/apt/sources.list.d" ] + then + readarray -t APT_SOURCES < <(find "/etc/apt/sources.list.d" -type f -name '*.sources' -print) + fi + if [ -f "/etc/apt/sources.list" ] + then + APT_SOURCES+=("/etc/apt/sources.list") + fi + if [ "${#APT_SOURCES[@]}" -gt 0 ] + then + sed -i -E -e 's!([^ ]+) (http|https)://(archive|security)\.ubuntu\.com/ubuntu[^ ]*(.*)!\1 http://azure.archive.ubuntu.com/ubuntu/\4!' "${APT_SOURCES[@]}" + fi + apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + if [ "$(apt-cache search "^python-is-python3$" | wc -l)" -ne 0 ] + then + PYTHON_PACKAGE="python-is-python3" + else + PYTHON_PACKAGE="python" + fi + apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ $PYTHON_PACKAGE python3 perl git cmake + fi + fi + git config --global pack.threads 0 + + - name: Install packages + if: matrix.install + run: | + declare -a SOURCE_KEYS SOURCES + if [ -n "${{join(matrix.source_keys, ' ')}}" ] + then + SOURCE_KEYS=("${{join(matrix.source_keys, '" "')}}") + fi + if [ -n "${{join(matrix.sources, ' ')}}" ] + then + SOURCES=("${{join(matrix.sources, '" "')}}") + fi + for key in "${SOURCE_KEYS[@]}" + do + for i in {1..$NET_RETRY_COUNT} + do + echo "Adding key: $key" + wget -O - "$key" | sudo apt-key add - && break || sleep 2 + done + done + if [ ${#SOURCES[@]} -gt 0 ] + then + APT_ADD_REPO_COMMON_ARGS=("-y") + APT_ADD_REPO_SUPPORTED_ARGS="$(apt-add-repository --help | perl -ne 'if (/^\s*-n/) { print "n"; } elsif (/^\s*-P/) { print "P"; } elsif (/^\s*-S/) { print "S"; } elsif (/^\s*-U/) { print "U"; }')" + if [ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*n*}" ] + then + APT_ADD_REPO_COMMON_ARGS+=("-n") + fi + APT_ADD_REPO_HAS_SOURCE_ARGS="$([ -n "$APT_ADD_REPO_SUPPORTED_ARGS" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*P*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*S*}" -a -z "${APT_ADD_REPO_SUPPORTED_ARGS##*U*}" ] && echo 1 || echo 0)" + for source in "${SOURCES[@]}" + do + for i in {1..$NET_RETRY_COUNT} + do + APT_ADD_REPO_ARGS=("${APT_ADD_REPO_COMMON_ARGS[@]}") + if [ $APT_ADD_REPO_HAS_SOURCE_ARGS -ne 0 ] + then + case "$source" in + "ppa:"*) + APT_ADD_REPO_ARGS+=("-P") + ;; + "deb "*) + APT_ADD_REPO_ARGS+=("-S") + ;; + *) + APT_ADD_REPO_ARGS+=("-U") + ;; + esac + fi + APT_ADD_REPO_ARGS+=("$source") + echo "apt-add-repository ${APT_ADD_REPO_ARGS[@]}" + sudo -E apt-add-repository "${APT_ADD_REPO_ARGS[@]}" && break || sleep 2 + done + done + fi + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y ${{join(matrix.install, ' ')}} + + - name: Setup GCC Toolchain + if: matrix.gcc_toolchain + run: | + GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain" + echo "GCC_TOOLCHAIN_ROOT=\"$GCC_TOOLCHAIN_ROOT\"" >> $GITHUB_ENV + MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" + mkdir -p "$GCC_TOOLCHAIN_ROOT" + ln -s /usr/include "$GCC_TOOLCHAIN_ROOT/include" + ln -s /usr/bin "$GCC_TOOLCHAIN_ROOT/bin" + mkdir -p "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET" + ln -s "/usr/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" + + - name: Setup Boost + run: | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + BUILD_JOBS=$((nproc || sysctl -n hw.ncpu) 2> /dev/null) + echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV + echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV + echo BUILD_JOBS: $BUILD_JOBS + declare -a DEPINST_ARGS=() + GIT_VERSION="$(git --version | sed -e 's/git version //')" + GIT_HAS_JOBS=1 + if [ -f "/etc/debian_version" ] + then + if $(dpkg --compare-versions "$GIT_VERSION" lt 2.8.0) + then + GIT_HAS_JOBS=0 + fi + else + declare -a GIT_VER=(${GIT_VERSION//./ }) + declare -a GIT_MIN_VER=(2 8 0) + for ((i=0; i<${#GIT_VER[@]}; i++)) + do + if [ -z "${GIT_MIN_VER[i]}" ] + then + GIT_MIN_VER[i]=0 + fi + if [ "${GIT_VER[i]}" -lt "${GIT_MIN_VER[i]}" ] + then + GIT_HAS_JOBS=0 + break + fi + done + fi + if [ "$GIT_HAS_JOBS" -ne 0 ] + then + DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS") + fi + mkdir -p snapshot + cd snapshot + echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz" + curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz" + tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz" + if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ] + then + echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:" + ls -la + exit 1 + fi + rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz" + cd .. + git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root" + cd boost-root + mkdir -p libs + rm -rf "libs/$LIBRARY" + mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY" + rm -rf "../snapshot" + git submodule update --init tools/boostdep + DEPINST_ARGS+=("$LIBRARY") + python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}" + rm -rf ".git" + cd .. + cat > b2-run-tests.sh << "EOF" + #!/usr/bin/env bash + set -e + cd boost-root + ./bootstrap.sh + ./b2 headers + if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ] + then + echo -n "using ${{matrix.toolset}} : : ${{matrix.compiler}}" > ~/user-config.jam + if [ -n "$GCC_TOOLCHAIN_ROOT" ] + then + echo -n " : \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\" \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\"" >> ~/user-config.jam + fi + echo " ;" >> ~/user-config.jam + fi + if [ -z "${{matrix.extra_tests}}" ] + then + export BOOST_THREAD_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1 + fi + declare -a B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}") + if [ -n "${{matrix.build_variant}}" ] + then + B2_ARGS+=("variant=${{matrix.build_variant}}") + else + B2_ARGS+=("variant=$DEFAULT_BUILD_VARIANT") + fi + if [ -n "${{matrix.threading}}" ] + then + B2_ARGS+=("threading=${{matrix.threading}}") + fi + if [ -n "${{matrix.ubsan}}" ] + then + export UBSAN_OPTIONS="print_stacktrace=1" + B2_ARGS+=("cxxflags=-fsanitize=undefined -fno-sanitize-recover=undefined" "linkflags=-fsanitize=undefined" "define=UBSAN=1" "debug-symbols=on" "visibility=global") + fi + if [ -n "${{matrix.cxxflags}}" ] + then + B2_ARGS+=("cxxflags=${{matrix.cxxflags}}") + fi + if [ -n "${{matrix.linkflags}}" ] + then + B2_ARGS+=("linkflags=${{matrix.linkflags}}") + fi + B2_ARGS+=("libs/$LIBRARY/test") + ./b2 "${B2_ARGS[@]}" + EOF + chmod +x b2-run-tests.sh + + # Note: The VMs must be created after the workspace is fully prepared, as it will be copied to the VM only once + - name: Setup FreeBSD VM + if: matrix.vm == 'freebsd' + uses: vmactions/freebsd-vm@v1 + with: + release: "${{matrix.version}}" + custom-shell-name: vmsh + usesh: true + sync: rsync + copyback: false + envs: "LANG LIBRARY DEFAULT_BUILD_VARIANT BUILD_JOBS GCC_TOOLCHAIN_ROOT" + prepare: | + pkg install -y bash + run: | + uname -mrs + sysctl hw.model + sysctl hw.ncpu + sysctl hw.physmem + sysctl hw.usermem + locale + pwd + ls -la + - name: Setup OpenBSD VM + if: matrix.vm == 'openbsd' + uses: vmactions/openbsd-vm@v1 + with: + release: "${{matrix.version}}" + custom-shell-name: vmsh + usesh: true + sync: rsync + copyback: false + envs: "LANG LIBRARY DEFAULT_BUILD_VARIANT BUILD_JOBS GCC_TOOLCHAIN_ROOT" + prepare: | + pkg_add bash + run: | + uname -mrs + sysctl hw.model + sysctl hw.ncpu + sysctl hw.physmem + sysctl hw.usermem + locale + pwd + ls -la + + - name: Setup NetBSD VM + if: matrix.vm == 'netbsd' + uses: vmactions/netbsd-vm@v1 + with: + release: "${{matrix.version}}" + custom-shell-name: vmsh + usesh: true + sync: rsync + copyback: false + envs: "LANG LIBRARY DEFAULT_BUILD_VARIANT BUILD_JOBS GCC_TOOLCHAIN_ROOT" + run: | + uname -mrs + /sbin/sysctl hw.model + /sbin/sysctl hw.ncpu + /sbin/sysctl hw.physmem64 + /sbin/sysctl hw.usermem64 + locale + pwd + ls -la + + - name: Setup DragonFlyBSD VM + if: matrix.vm == 'dragonflybsd' + uses: vmactions/dragonflybsd-vm@v1 + with: + release: "${{matrix.version}}" + custom-shell-name: vmsh + usesh: true + sync: rsync + copyback: false + envs: "LANG LIBRARY DEFAULT_BUILD_VARIANT BUILD_JOBS GCC_TOOLCHAIN_ROOT" + prepare: | + pkg install -y bash + run: | + uname -mrs + sysctl hw.model + sysctl hw.ncpu + sysctl hw.physmem + sysctl hw.usermem + locale + pwd + ls -la + + - name: Setup Solaris VM + if: matrix.vm == 'solaris' + uses: vmactions/solaris-vm@v1 + with: + release: "${{matrix.version}}" + custom-shell-name: vmsh + usesh: true + sync: rsync + copyback: false + envs: "LANG LIBRARY DEFAULT_BUILD_VARIANT BUILD_JOBS GCC_TOOLCHAIN_ROOT" + run: | + uname -mrs + locale + pwd + ls -la + + - name: Setup OmniOS VM + if: matrix.vm == 'omnios' + uses: vmactions/omnios-vm@v1 + with: + release: "${{matrix.version}}" + custom-shell-name: vmsh + usesh: true + sync: rsync + copyback: false + envs: "LANG LIBRARY DEFAULT_BUILD_VARIANT BUILD_JOBS GCC_TOOLCHAIN_ROOT" + run: | + uname -mrs + locale + pwd + ls -la + + - name: Setup OpenIndiana VM + if: matrix.vm == 'openindiana' + uses: vmactions/openindiana-vm@v1 + with: + release: "${{matrix.version}}" + custom-shell-name: vmsh + usesh: true + sync: rsync + copyback: false + envs: "LANG LIBRARY DEFAULT_BUILD_VARIANT BUILD_JOBS GCC_TOOLCHAIN_ROOT" + run: | + uname -mrs + locale + pwd + ls -la + + - name: Run tests + if: matrix.cmake_tests == '' && matrix.vm == '' + run: | + bash ./b2-run-tests.sh + + - name: Run tests (VM) + if: matrix.cmake_tests == '' && matrix.vm != '' + shell: vmsh {0} + run: | + cd "$GITHUB_WORKSPACE" + bash ./b2-run-tests.sh + + windows: defaults: run: - shell: bash + shell: cmd + + strategy: + fail-fast: false + matrix: + include: + - toolset: msvc-14.3 + cxxstd: "14" + addrmd: 64 + extra_tests: 1 + os: windows-2022 + - toolset: msvc-14.3 + cxxstd: "17,20,latest" + addrmd: 64 + os: windows-2022 + - toolset: msvc-14.3 + cxxstd: "14,17" + addrmd: 32 + os: windows-2022 + - toolset: msvc-14.3 + cxxstd: "20,latest" + addrmd: 32 + os: windows-2022 + - toolset: clang-win + cxxstd: "14,17,latest" + addrmd: 64 + os: windows-2022 + - toolset: clang-win + cxxstd: "14,17,latest" + addrmd: 32 + os: windows-2022 + - toolset: gcc + cxxstd: "17,20,23" + addrmd: 64 + build_variant: debug + os: windows-2022 + + timeout-minutes: 150 + runs-on: ${{matrix.os}} steps: - - name: Setup container environment - if: matrix.container + - name: Setup Boost run: | - apt-get update - apt-get -y install sudo python3 git g++ curl xz-utils + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + mkdir snapshot + cd snapshot + echo Downloading library snapshot: https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip + curl -L --retry %NET_RETRY_COUNT% -o "%LIBRARY%-%GITHUB_SHA%.zip" "https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip" + tar -xf "%LIBRARY%-%GITHUB_SHA%.zip" + if not exist "%LIBRARY%-%GITHUB_SHA%\" ( + echo Library snapshot does not contain the library directory %LIBRARY%-%GITHUB_SHA%: + dir + exit /b 1 + ) + del /f "%LIBRARY%-%GITHUB_SHA%.zip" + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + if not exist "libs\" mkdir libs + if exist "libs\%LIBRARY%\" rmdir /s /q "libs\%LIBRARY%" + move /Y "..\snapshot\%LIBRARY%-%GITHUB_SHA%" "libs\%LIBRARY%" + rmdir /s /q "..\snapshot" + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY% + if "${{matrix.cmake_tests}}" == "" ( + cmd /c bootstrap + b2 -d0 headers + ) - - name: Install nodejs20glibc2.17 - if: ${{ startsWith( matrix.container, 'ubuntu:1' ) }} + - name: Run tests + if: matrix.cmake_tests == '' run: | - curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz - tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217 - ldd /__e/node20/bin/node + cd boost-root + if not "${{matrix.cxxstd}}" == "" set CXXSTD=cxxstd=${{matrix.cxxstd}} + if not "${{matrix.addrmd}}" == "" set ADDRMD=address-model=${{matrix.addrmd}} + if not "${{matrix.build_variant}}" == "" (set BUILD_VARIANT=variant=${{matrix.build_variant}}) else (set BUILD_VARIANT=variant=%DEFAULT_BUILD_VARIANT%) + if "${{matrix.extra_tests}}" == "" set BOOST_THREAD_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1 + b2 -j %NUMBER_OF_PROCESSORS% libs/%LIBRARY%/test toolset=${{matrix.toolset}} %CXXSTD% %ADDRMD% %BUILD_VARIANT% embed-manifest-via=linker - - uses: actions/checkout@v4 + MSYS2: + defaults: + run: + shell: msys2 {0} + strategy: + fail-fast: false + matrix: + include: + - sys: MINGW32 + toolset: gcc + cxxstd: '17,20,23' + build_variant: debug + - sys: MINGW64 + toolset: gcc + cxxstd: '17,20,23' + build_variant: debug - - name: Install packages - if: matrix.install - run: | - sudo apt-get update - sudo apt-get -y install ${{matrix.install}} + timeout-minutes: 150 + runs-on: windows-latest + + steps: + - name: Setup MSYS2 environment + uses: msys2/setup-msys2@v2 + with: + msystem: ${{matrix.sys}} + update: true + install: git python + pacboy: gcc:p - name: Setup Boost run: | - echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY - LIBRARY=${GITHUB_REPOSITORY#*/} - echo LIBRARY: $LIBRARY - echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV - echo GITHUB_BASE_REF: $GITHUB_BASE_REF - echo GITHUB_REF: $GITHUB_REF - REF=${GITHUB_BASE_REF:-$GITHUB_REF} - REF=${REF#refs/heads/} - echo REF: $REF - BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true - echo BOOST_BRANCH: $BOOST_BRANCH - cd .. - git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root - cd boost-root - cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY - git submodule update --init tools/boostdep - python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY - ./bootstrap.sh - ./b2 -d0 headers - - - name: Create user-config.jam - if: matrix.compiler + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + BUILD_JOBS=$((nproc || sysctl -n hw.ncpu) 2> /dev/null) + echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV + echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV + mkdir -p snapshot + cd snapshot + echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz" + curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz" + tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz" + if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ] + then + echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:" + ls -la + exit 1 + fi + rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz" + cd .. + git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root" + cd boost-root + mkdir -p libs + rm -rf "libs/$LIBRARY" + mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY" + rm -rf "../snapshot" + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs $GIT_FETCH_JOBS" "$LIBRARY" + ./bootstrap.sh + ./b2 headers + + - name: Run tests + run: | + cd boost-root + if [ -z "${{matrix.extra_tests}}" ] + then + export BOOST_THREAD_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1 + fi + declare -a B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}") + if [ -n "${{matrix.build_variant}}" ] + then + B2_ARGS+=("variant=${{matrix.build_variant}}") + else + B2_ARGS+=("variant=$DEFAULT_BUILD_VARIANT") + fi + if [ -n "${{matrix.threading}}" ] + then + B2_ARGS+=("threading=${{matrix.threading}}") + fi + if [ -n "${{matrix.ubsan}}" ] + then + export UBSAN_OPTIONS="print_stacktrace=1" + B2_ARGS+=("cxxflags=-fsanitize=undefined -fno-sanitize-recover=undefined" "linkflags=-fsanitize=undefined" "define=UBSAN=1" "debug-symbols=on" "visibility=global") + fi + if [ -n "${{matrix.cxxflags}}" ] + then + B2_ARGS+=("cxxflags=${{matrix.cxxflags}}") + fi + if [ -n "${{matrix.linkflags}}" ] + then + B2_ARGS+=("linkflags=${{matrix.linkflags}}") + fi + B2_ARGS+=("libs/$LIBRARY/test") + ./b2 "${B2_ARGS[@]}" + + cygwin: + defaults: + run: + shell: bash + + env: + SHELLOPTS: igncr + CYGWIN: winsymlinks:native + + strategy: + fail-fast: false + matrix: + include: + - toolset: gcc + cxxstd: "11-gnu" + extra_tests: 1 + build_variant: debug + - toolset: gcc + cxxstd: "14-gnu,17-gnu" + build_variant: debug + - toolset: gcc + cxxstd: "20-gnu" + build_variant: debug + - toolset: gcc + cxxstd: "23-gnu" + build_variant: debug + + timeout-minutes: 150 + runs-on: windows-latest + + steps: + - name: Configure git + run: | + git config --global core.autocrlf input + + - name: Install Cygwin + uses: cygwin/cygwin-install-action@v6 + with: + packages: + gcc-g++ + + - name: Setup Boost run: | - echo "using ${{matrix.toolset}} : : ${{matrix.compiler}} ;" > ~/user-config.jam + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY + LIBRARY=${GITHUB_REPOSITORY#*/} + echo LIBRARY: $LIBRARY + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV + echo GITHUB_BASE_REF: $GITHUB_BASE_REF + echo GITHUB_REF: $GITHUB_REF + REF=${GITHUB_BASE_REF:-$GITHUB_REF} + REF=${REF#refs/heads/} + echo REF: $REF + BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true + echo BOOST_BRANCH: $BOOST_BRANCH + BUILD_JOBS=$((nproc) 2> /dev/null) + echo "BUILD_JOBS=$BUILD_JOBS" >> $GITHUB_ENV + echo "CMAKE_BUILD_PARALLEL_LEVEL=$BUILD_JOBS" >> $GITHUB_ENV + declare -a DEPINST_ARGS=("--git_args" "--jobs $GIT_FETCH_JOBS") + mkdir -p snapshot + cd snapshot + echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz" + curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz" + tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz" + if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ] + then + echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:" + ls -la + exit 1 + fi + rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz" + cd .. + git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root" + cd boost-root + mkdir -p libs + rm -rf "libs/$LIBRARY" + mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY" + rm -rf "../snapshot" + git submodule update --init tools/boostdep + DEPINST_ARGS+=("$LIBRARY") + python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}" + ./bootstrap.sh + ./b2 -d0 headers - name: Run tests run: | - cd ../boost-root - export CXXSTD=${{matrix.cxxstd}} - ./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} ${CXXSTD:+cxxstd=$CXXSTD} variant=debug,release + cd boost-root + if [ -z "${{matrix.extra_tests}}" ] + then + export BOOST_THREAD_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS=1 + fi + declare -a B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}") + if [ -n "${{matrix.build_variant}}" ] + then + B2_ARGS+=("variant=${{matrix.build_variant}}") + else + B2_ARGS+=("variant=$DEFAULT_BUILD_VARIANT") + fi + if [ -n "${{matrix.threading}}" ] + then + B2_ARGS+=("threading=${{matrix.threading}}") + fi + if [ -n "${{matrix.ubsan}}" ] + then + export UBSAN_OPTIONS="print_stacktrace=1" + B2_ARGS+=("cxxflags=-fsanitize=undefined -fno-sanitize-recover=undefined" "linkflags=-fsanitize=undefined" "define=UBSAN=1" "debug-symbols=on" "visibility=global") + fi + if [ -n "${{matrix.cxxflags}}" ] + then + B2_ARGS+=("cxxflags=${{matrix.cxxflags}}") + fi + if [ -n "${{matrix.linkflags}}" ] + then + B2_ARGS+=("linkflags=${{matrix.linkflags}}") + fi + B2_ARGS+=("libs/$LIBRARY/test") + ./b2 "${B2_ARGS[@]}" From ef5505e0a1c9000406aa7e496cc389eaa07debb3 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 1 Jul 2026 00:17:43 +0300 Subject: [PATCH 52/80] Join test threads before checking for notification count. In condition variable notification tests, join the test threads before making the final check for the number of notifications instead of relying on timeouts. This should make the tests more reliable, especially on Windows. --- test/test_condition_notify_all.cpp | 14 +++++--------- test/test_condition_notify_one.cpp | 11 +++++------ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/test/test_condition_notify_all.cpp b/test/test_condition_notify_all.cpp index 17c84d5d50..ab62709be2 100644 --- a/test/test_condition_notify_all.cpp +++ b/test/test_condition_notify_all.cpp @@ -190,16 +190,15 @@ void do_test_notify_all_following_notify_one_wakes_all_threads() boost::this_thread::sleep(boost::posix_time::milliseconds(200)); multiple_wake_cond.notify_one(); multiple_wake_cond.notify_all(); - boost::this_thread::sleep(boost::posix_time::milliseconds(200)); - - { - boost::unique_lock lk(multiple_wake_mutex); - BOOST_CHECK(multiple_wake_count==3); - } thread1.join(); thread2.join(); thread3.join(); + + { + boost::unique_lock lk(multiple_wake_mutex); + BOOST_CHECK_EQUAL(multiple_wake_count, 3u); + } } BOOST_AUTO_TEST_CASE(test_condition_notify_all) @@ -211,6 +210,3 @@ BOOST_AUTO_TEST_CASE(test_condition_notify_all) timed_test(&do_test_condition_notify_all_wakes_from_relative_timed_wait_with_predicate, timeout_seconds); timed_test(&do_test_notify_all_following_notify_one_wakes_all_threads, timeout_seconds); } - - - diff --git a/test/test_condition_notify_one.cpp b/test/test_condition_notify_one.cpp index 00aff62687..5a35c6bdf6 100644 --- a/test/test_condition_notify_one.cpp +++ b/test/test_condition_notify_one.cpp @@ -125,16 +125,15 @@ void do_test_multiple_notify_one_calls_wakes_multiple_threads() boost::this_thread::sleep(boost::posix_time::milliseconds(200)); multiple_wake_cond.notify_one(); multiple_wake_cond.notify_one(); - boost::this_thread::sleep(boost::posix_time::milliseconds(200)); - - { - boost::unique_lock lk(multiple_wake_mutex); - BOOST_CHECK(multiple_wake_count==3); - } thread1.join(); thread2.join(); thread3.join(); + + { + boost::unique_lock lk(multiple_wake_mutex); + BOOST_CHECK_EQUAL(multiple_wake_count, 3u); + } } BOOST_AUTO_TEST_CASE(test_condition_notify_one) From 559143bde29387e6cb58223f18d2f3d9c5b0acfe Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 2 Jul 2026 11:27:45 +0300 Subject: [PATCH 53/80] Added timeout grace period to condition variable notify tests. This should reduce the likelihood of test failures due to timeouts. --- test/test_condition_notify_all.cpp | 13 +++++++------ test/test_condition_notify_one.cpp | 14 ++++++++------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/test/test_condition_notify_all.cpp b/test/test_condition_notify_all.cpp index ab62709be2..078604ba2a 100644 --- a/test/test_condition_notify_all.cpp +++ b/test/test_condition_notify_all.cpp @@ -15,6 +15,7 @@ #include "./condition_test_common.hpp" unsigned const number_of_test_threads=5; +unsigned const timeout_grace=1; void do_test_condition_notify_all_wakes_from_wait() { @@ -203,10 +204,10 @@ void do_test_notify_all_following_notify_one_wakes_all_threads() BOOST_AUTO_TEST_CASE(test_condition_notify_all) { - timed_test(&do_test_condition_notify_all_wakes_from_wait, timeout_seconds); - timed_test(&do_test_condition_notify_all_wakes_from_wait_with_predicate, timeout_seconds); - timed_test(&do_test_condition_notify_all_wakes_from_timed_wait, timeout_seconds); - timed_test(&do_test_condition_notify_all_wakes_from_timed_wait_with_predicate, timeout_seconds); - timed_test(&do_test_condition_notify_all_wakes_from_relative_timed_wait_with_predicate, timeout_seconds); - timed_test(&do_test_notify_all_following_notify_one_wakes_all_threads, timeout_seconds); + timed_test(&do_test_condition_notify_all_wakes_from_wait, timeout_seconds+timeout_grace); + timed_test(&do_test_condition_notify_all_wakes_from_wait_with_predicate, timeout_seconds+timeout_grace); + timed_test(&do_test_condition_notify_all_wakes_from_timed_wait, timeout_seconds+timeout_grace); + timed_test(&do_test_condition_notify_all_wakes_from_timed_wait_with_predicate, timeout_seconds+timeout_grace); + timed_test(&do_test_condition_notify_all_wakes_from_relative_timed_wait_with_predicate, timeout_seconds+timeout_grace); + timed_test(&do_test_notify_all_following_notify_one_wakes_all_threads, timeout_seconds+timeout_grace); } diff --git a/test/test_condition_notify_one.cpp b/test/test_condition_notify_one.cpp index 5a35c6bdf6..42c59fb844 100644 --- a/test/test_condition_notify_one.cpp +++ b/test/test_condition_notify_one.cpp @@ -16,6 +16,8 @@ #include "./util.inl" #include "./condition_test_common.hpp" +unsigned const timeout_grace=1; + void do_test_condition_notify_one_wakes_from_wait() { wait_for_flag data; @@ -138,10 +140,10 @@ void do_test_multiple_notify_one_calls_wakes_multiple_threads() BOOST_AUTO_TEST_CASE(test_condition_notify_one) { - timed_test(&do_test_condition_notify_one_wakes_from_wait, timeout_seconds, execution_monitor::use_mutex); - timed_test(&do_test_condition_notify_one_wakes_from_wait_with_predicate, timeout_seconds, execution_monitor::use_mutex); - timed_test(&do_test_condition_notify_one_wakes_from_timed_wait, timeout_seconds, execution_monitor::use_mutex); - timed_test(&do_test_condition_notify_one_wakes_from_timed_wait_with_predicate, timeout_seconds, execution_monitor::use_mutex); - timed_test(&do_test_condition_notify_one_wakes_from_relative_timed_wait_with_predicate, timeout_seconds, execution_monitor::use_mutex); - timed_test(&do_test_multiple_notify_one_calls_wakes_multiple_threads, timeout_seconds, execution_monitor::use_mutex); + timed_test(&do_test_condition_notify_one_wakes_from_wait, timeout_seconds+timeout_grace, execution_monitor::use_mutex); + timed_test(&do_test_condition_notify_one_wakes_from_wait_with_predicate, timeout_seconds+timeout_grace, execution_monitor::use_mutex); + timed_test(&do_test_condition_notify_one_wakes_from_timed_wait, timeout_seconds+timeout_grace, execution_monitor::use_mutex); + timed_test(&do_test_condition_notify_one_wakes_from_timed_wait_with_predicate, timeout_seconds+timeout_grace, execution_monitor::use_mutex); + timed_test(&do_test_condition_notify_one_wakes_from_relative_timed_wait_with_predicate, timeout_seconds+timeout_grace, execution_monitor::use_mutex); + timed_test(&do_test_multiple_notify_one_calls_wakes_multiple_threads, timeout_seconds+timeout_grace, execution_monitor::use_mutex); } From b140c29da34badb38211e9c73636cd82bde0521a Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 1 Jul 2026 00:39:34 +0300 Subject: [PATCH 54/80] Use barriers in timed try_join tests. Use thread barriers to synchronize between test threads to improve test reliability. --- .../thread/members/try_join_for_pass.cpp | 27 +++++++++++++++---- .../thread/members/try_join_until_pass.cpp | 27 +++++++++++++++---- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/test/threads/thread/members/try_join_for_pass.cpp b/test/threads/thread/members/try_join_for_pass.cpp index 41b357ac52..8e3295830a 100644 --- a/test/threads/thread/members/try_join_for_pass.cpp +++ b/test/threads/thread/members/try_join_for_pass.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -32,15 +33,23 @@ class G { + boost::barrier* bar_; int alive_; public: static bool op_run; G() : + bar_(nullptr), + alive_(1) + { + } + explicit G(boost::barrier& bar) : + bar_(&bar), alive_(1) { } G(const G& g) : + bar_(g.bar_), alive_(g.alive_) { } @@ -52,6 +61,8 @@ class G void operator()() { BOOST_TEST(alive_ == 1); + if (bar_) + bar_->count_down_and_wait(); op_run = true; } }; @@ -86,9 +97,11 @@ void th_250_ms() int main() { { - boost::thread t0( (G())); + boost::barrier bar(2u); + boost::thread t0( (G(bar))); BOOST_TEST(t0.joinable()); - BOOST_TEST(t0.try_join_for(boost::chrono::milliseconds(250))); + bar.count_down_and_wait(); + BOOST_TEST(t0.try_join_for(boost::chrono::milliseconds(500))); BOOST_TEST(!t0.joinable()); } { @@ -123,8 +136,10 @@ int main() } } { - boost::thread t0( (G())); + boost::barrier bar(2u); + boost::thread t0( (G(bar))); BOOST_TEST(t0.joinable()); + bar.count_down_and_wait(); t0.join(); try { @@ -138,9 +153,11 @@ int main() } { - boost::thread t0( (G())); + boost::barrier bar(2u); + boost::thread t0( (G(bar))); BOOST_TEST(t0.joinable()); - t0.try_join_for(boost::chrono::milliseconds(250)); + bar.count_down_and_wait(); + t0.try_join_for(boost::chrono::milliseconds(500)); try { t0.join(); diff --git a/test/threads/thread/members/try_join_until_pass.cpp b/test/threads/thread/members/try_join_until_pass.cpp index ed9d2ad65c..7473aac07b 100644 --- a/test/threads/thread/members/try_join_until_pass.cpp +++ b/test/threads/thread/members/try_join_until_pass.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -32,15 +33,23 @@ class G { + boost::barrier* bar_; int alive_; public: static bool op_run; G() : + bar_(nullptr), + alive_(1) + { + } + explicit G(boost::barrier& bar) : + bar_(&bar), alive_(1) { } G(const G& g) : + bar_(g.bar_), alive_(g.alive_) { } @@ -52,6 +61,8 @@ class G void operator()() { BOOST_TEST(alive_ == 1); + if (bar_) + bar_->count_down_and_wait(); op_run = true; } }; @@ -87,9 +98,11 @@ void th_250_ms() int main() { { - boost::thread t0( (G())); + boost::barrier bar(2u); + boost::thread t0( (G(bar))); BOOST_TEST(t0.joinable()); - t0.try_join_until(boost::chrono::steady_clock::now()+boost::chrono::milliseconds(250)); + bar.count_down_and_wait(); + t0.try_join_until(boost::chrono::steady_clock::now()+boost::chrono::milliseconds(500)); BOOST_TEST(!t0.joinable()); } { @@ -124,8 +137,10 @@ int main() } } { - boost::thread t0( (G())); + boost::barrier bar(2u); + boost::thread t0( (G(bar))); BOOST_TEST(t0.joinable()); + bar.count_down_and_wait(); t0.join(); try { @@ -139,9 +154,11 @@ int main() } { - boost::thread t0( (G())); + boost::barrier bar(2u); + boost::thread t0( (G(bar))); BOOST_TEST(t0.joinable()); - t0.try_join_until(boost::chrono::steady_clock::now()+boost::chrono::milliseconds(250)); + bar.count_down_and_wait(); + t0.try_join_until(boost::chrono::steady_clock::now()+boost::chrono::milliseconds(500)); try { t0.join(); From fc290ec4be209b38e3d15d006222c66679991399 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 1 Jul 2026 00:16:18 +0300 Subject: [PATCH 55/80] Renamed global variables to avoid name clashes with local variables. This should silence MSVC warnings about local variables in various places shadowing global variables in the tests. --- .../condition_variable/dtor_pass.cpp | 26 ++++----- .../condition_variable_any/dtor_pass.cpp | 26 ++++----- .../futures/async/async_executor_pass.cpp | 4 +- test/sync/futures/async/async_pass.cpp | 16 +++--- test/sync/futures/future/get_or_pass.cpp | 6 +- test/sync/futures/future/get_pass.cpp | 6 +- test/sync/futures/future/move_assign_pass.cpp | 3 - test/sync/futures/future/move_ctor_pass.cpp | 3 - test/sync/futures/future/wait_for_pass.cpp | 6 +- test/sync/futures/future/wait_pass.cpp | 6 +- test/sync/futures/future/wait_until_pass.cpp | 6 +- .../sync/futures/promise/move_assign_pass.cpp | 3 - test/sync/futures/promise/move_ctor_pass.cpp | 3 - .../set_lvalue_at_thread_exit_pass.cpp | 14 ++--- .../set_rvalue_at_thread_exit_pass.cpp | 12 ++-- .../set_value_at_thread_exit_const_pass.cpp | 14 ++--- .../set_value_at_thread_exit_void_pass.cpp | 22 ++++---- .../shared_future/move_assign_pass.cpp | 3 - .../futures/shared_future/move_ctor_pass.cpp | 3 - .../locks/lock_guard/adopt_lock_pass.cpp | 32 +++++------ .../locks/lock_guard/copy_assign_fail.cpp | 10 ++-- .../locks/lock_guard/copy_ctor_fail.cpp | 5 +- .../locks/lock_guard/default_pass.cpp | 28 +++++----- .../lock_guard_adopt_lock_compile_fail.cpp | 4 +- .../lock_guard_adopt_lock_compile_pass.cpp | 6 +- .../lock_guard/lock_guard_compile_fail.cpp | 6 +- .../lock_guard/lock_guard_compile_pass.cpp | 6 +- .../make_lock_guard_adopt_lock_pass.cpp | 32 +++++------ .../locks/lock_guard/make_lock_guard_pass.cpp | 18 +++--- .../nested_strict_lock/copy_assign_fail.cpp | 9 ++- .../nested_strict_lock/copy_ctor_fail.cpp | 6 +- .../locks/nested_strict_lock/default_pass.cpp | 28 +++++----- .../make_nested_strict_lock_pass.cpp | 18 +++--- .../locks/reverse_lock/copy_ctor_fail.cpp | 4 -- .../shared_lock/cons/copy_assign_fail.cpp | 10 ++-- .../locks/shared_lock/cons/copy_ctor_fail.cpp | 9 ++- .../locks/shared_lock/cons/duration_pass.cpp | 30 +++++----- .../shared_lock/cons/move_assign_pass.cpp | 40 ++++++------- .../locks/shared_lock/cons/move_ctor_pass.cpp | 22 ++++---- .../cons/move_ctor_unique_lock_pass.cpp | 49 ++++++++-------- .../cons/move_ctor_upgrade_lock_pass.cpp | 48 ++++++++-------- .../locks/shared_lock/cons/mutex_pass.cpp | 28 +++++----- .../shared_lock/cons/time_point_pass.cpp | 30 +++++----- .../shared_lock/cons/try_to_lock_pass.cpp | 38 ++++++------- .../locks/shared_lock/locking/lock_pass.cpp | 26 ++++----- .../shared_lock/locking/try_lock_for_pass.cpp | 4 +- .../shared_lock/locking/try_lock_pass.cpp | 4 +- .../locking/try_lock_until_pass.cpp | 4 +- .../locks/shared_lock/locking/unlock_pass.cpp | 4 +- .../shared_lock/mod/member_swap_pass.cpp | 6 +- .../shared_lock/mod/non_member_swap_pass.cpp | 6 +- .../locks/shared_lock/mod/release_pass.cpp | 8 +-- .../locks/shared_lock/obs/mutex_pass.cpp | 8 +-- .../locks/shared_lock/obs/op_bool_pass.cpp | 4 +- .../locks/shared_lock/obs/owns_lock_pass.cpp | 4 +- .../shared_lock_guard/adopt_lock_pass.cpp | 32 +++++------ .../shared_lock_guard/copy_assign_fail.cpp | 10 ++-- .../shared_lock_guard/copy_ctor_fail.cpp | 6 +- .../locks/shared_lock_guard/default_pass.cpp | 28 +++++----- .../locks/strict_lock/copy_assign_fail.cpp | 10 ++-- .../locks/strict_lock/copy_ctor_fail.cpp | 5 +- .../locks/strict_lock/default_pass.cpp | 28 +++++----- .../strict_lock/make_strict_lock_pass.cpp | 20 +++---- .../unique_lock/cons/copy_assign_fail.cpp | 11 ++-- .../locks/unique_lock/cons/copy_ctor_fail.cpp | 9 ++- .../locks/unique_lock/cons/duration_pass.cpp | 30 +++++----- .../cons/make_unique_lock_mutex_pass.cpp | 28 +++++----- .../make_unique_lock_try_to_lock_pass.cpp | 56 +++++++++---------- .../cons/make_unique_locks_mutex_pass.cpp | 40 ++++++------- .../unique_lock/cons/move_assign_pass.cpp | 20 +++---- .../locks/unique_lock/cons/move_ctor_pass.cpp | 16 +++--- .../cons/move_ctor_shared_lock_for_pass.cpp | 16 +++--- .../cons/move_ctor_shared_lock_try_pass.cpp | 47 ++++++++-------- .../cons/move_ctor_shared_lock_until_pass.cpp | 16 +++--- .../cons/move_ctor_upgrade_lock_for_pass.cpp | 16 +++--- .../cons/move_ctor_upgrade_lock_pass.cpp | 46 +++++++-------- .../cons/move_ctor_upgrade_lock_try_pass.cpp | 47 ++++++++-------- .../move_ctor_upgrade_lock_until_pass.cpp | 17 +++--- .../locks/unique_lock/cons/mutex_pass.cpp | 28 +++++----- .../unique_lock/cons/time_point_pass.cpp | 30 +++++----- .../unique_lock/cons/try_to_lock_pass.cpp | 40 ++++++------- .../locks/unique_lock/locking/lock_pass.cpp | 26 ++++----- .../unique_lock/locking/try_lock_for_pass.cpp | 4 +- .../unique_lock/locking/try_lock_pass.cpp | 4 +- .../locking/try_lock_until_pass.cpp | 4 +- .../locks/unique_lock/locking/unlock_pass.cpp | 4 +- .../unique_lock/mod/member_swap_pass.cpp | 6 +- .../unique_lock/mod/non_member_swap_pass.cpp | 6 +- .../locks/unique_lock/mod/release_pass.cpp | 8 +-- .../locks/unique_lock/obs/mutex_pass.cpp | 8 +-- .../locks/unique_lock/obs/op_bool_pass.cpp | 6 +- .../locks/unique_lock/obs/op_int_fail.cpp | 2 - .../upgrade_lock/cons/copy_assign_fail.cpp | 11 ++-- .../upgrade_lock/cons/copy_ctor_fail.cpp | 8 +-- .../locks/upgrade_lock/cons/duration_pass.cpp | 31 +++++----- .../upgrade_lock/cons/move_assign_pass.cpp | 29 +++++----- .../upgrade_lock/cons/move_ctor_pass.cpp | 10 ++-- .../cons/move_ctor_shared_lock_for_pass.cpp | 16 +++--- .../cons/move_ctor_shared_lock_try_pass.cpp | 47 ++++++++-------- .../cons/move_ctor_shared_lock_until_pass.cpp | 16 +++--- .../cons/move_ctor_unique_lock_pass.cpp | 20 +++---- .../locks/upgrade_lock/cons/mutex_pass.cpp | 28 +++++----- .../upgrade_lock/cons/time_point_pass.cpp | 30 +++++----- .../upgrade_lock/cons/try_to_lock_pass.cpp | 40 ++++++------- .../locks/upgrade_lock/locking/lock_pass.cpp | 26 ++++----- .../locking/try_lock_for_pass.cpp | 4 +- .../upgrade_lock/locking/try_lock_pass.cpp | 4 +- .../locking/try_lock_until_pass.cpp | 4 +- .../upgrade_lock/locking/unlock_pass.cpp | 4 +- .../upgrade_lock/mod/member_swap_pass.cpp | 6 +- .../upgrade_lock/mod/non_member_swap_pass.cpp | 6 +- .../locks/upgrade_lock/mod/release_pass.cpp | 8 +-- .../locks/upgrade_lock/obs/mutex_pass.cpp | 8 +-- .../locks/upgrade_lock/obs/op_bool_pass.cpp | 4 +- .../locks/upgrade_lock/obs/owns_lock_pass.cpp | 4 +- .../sync/mutual_exclusion/mutex/lock_pass.cpp | 30 +++++----- .../mutual_exclusion/mutex/try_lock_pass.cpp | 45 +++++++-------- .../mutual_exclusion/null_mutex/lock_pass.cpp | 22 ++++---- .../null_mutex/try_lock_for_pass.cpp | 14 ++--- .../null_mutex/try_lock_pass.cpp | 22 ++++---- .../null_mutex/try_lock_until_pass.cpp | 10 ++-- .../recursive_mutex/assign_fail.cpp | 1 - .../recursive_mutex/lock_pass.cpp | 38 ++++++------- .../recursive_mutex/try_lock_pass.cpp | 50 ++++++++--------- .../recursive_timed_mutex/lock_pass.cpp | 38 ++++++------- .../try_lock_for_pass.cpp | 36 ++++++------ .../recursive_timed_mutex/try_lock_pass.cpp | 50 ++++++++--------- .../try_lock_until_pass.cpp | 32 +++++------ .../shared_mutex/lock_pass.cpp | 31 +++++----- .../shared_mutex/try_lock_for_pass.cpp | 32 +++++------ .../shared_mutex/try_lock_pass.cpp | 43 +++++++------- .../shared_mutex/try_lock_until_pass.cpp | 32 +++++------ .../timed_mutex/lock_pass.cpp | 30 +++++----- .../timed_mutex/try_lock_for_pass.cpp | 32 +++++------ .../timed_mutex/try_lock_pass.cpp | 42 +++++++------- .../timed_mutex/try_lock_until_pass.cpp | 32 +++++------ test/test_once.cpp | 30 +++++----- test/threads/container/thread_vector_pass.cpp | 14 ++--- 138 files changed, 1252 insertions(+), 1324 deletions(-) diff --git a/test/sync/conditions/condition_variable/dtor_pass.cpp b/test/sync/conditions/condition_variable/dtor_pass.cpp index 34b4a1cc7c..0fc4f4a03d 100644 --- a/test/sync/conditions/condition_variable/dtor_pass.cpp +++ b/test/sync/conditions/condition_variable/dtor_pass.cpp @@ -23,8 +23,8 @@ #include #include -boost::condition_variable* cv; -boost::mutex m; +boost::condition_variable* g_cv; +boost::mutex g_mutex; typedef boost::unique_lock 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); diff --git a/test/sync/conditions/condition_variable_any/dtor_pass.cpp b/test/sync/conditions/condition_variable_any/dtor_pass.cpp index 15930311ed..228723e412 100644 --- a/test/sync/conditions/condition_variable_any/dtor_pass.cpp +++ b/test/sync/conditions/condition_variable_any/dtor_pass.cpp @@ -23,8 +23,8 @@ #include #include -boost::condition_variable_any* cv; -boost::timed_mutex m; +boost::condition_variable_any* g_cv; +boost::timed_mutex g_mutex; typedef boost::unique_lock 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); diff --git a/test/sync/futures/async/async_executor_pass.cpp b/test/sync/futures/async/async_executor_pass.cpp index 7e2e3ae5fd..6ab1fae850 100644 --- a/test/sync/futures/async/async_executor_pass.cpp +++ b/test/sync/futures/async/async_executor_pass.cpp @@ -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() diff --git a/test/sync/futures/async/async_pass.cpp b/test/sync/futures/async/async_pass.cpp index d5e5daff40..a287300e3b 100644 --- a/test/sync/futures/async/async_pass.cpp +++ b/test/sync/futures/async/async_pass.cpp @@ -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) { diff --git a/test/sync/futures/future/get_or_pass.cpp b/test/sync/futures/future/get_or_pass.cpp index 1fee228dc8..dd2040d878 100644 --- a/test/sync/futures/future/get_or_pass.cpp +++ b/test/sync/futures/future/get_or_pass.cpp @@ -51,13 +51,13 @@ void func2(boost::promise p) p.set_exception(::make_exception_ptr(3)); } -int j = 0; +int g_j = 0; void func3(boost::promise 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 p) diff --git a/test/sync/futures/future/get_pass.cpp b/test/sync/futures/future/get_pass.cpp index 043eade33f..1d865b795a 100644 --- a/test/sync/futures/future/get_pass.cpp +++ b/test/sync/futures/future/get_pass.cpp @@ -61,13 +61,13 @@ void func2(boost::promise p) p.set_exception(::make_exception_ptr(3)); } -int j = 0; +int g_j = 0; void func3(boost::promise 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 p) diff --git a/test/sync/futures/future/move_assign_pass.cpp b/test/sync/futures/future/move_assign_pass.cpp index 19007111a6..86851efe9c 100644 --- a/test/sync/futures/future/move_assign_pass.cpp +++ b/test/sync/futures/future/move_assign_pass.cpp @@ -23,9 +23,6 @@ #include #include -boost::mutex m0; -boost::mutex m1; - int main() { { diff --git a/test/sync/futures/future/move_ctor_pass.cpp b/test/sync/futures/future/move_ctor_pass.cpp index 701407d22a..6d1748419d 100644 --- a/test/sync/futures/future/move_ctor_pass.cpp +++ b/test/sync/futures/future/move_ctor_pass.cpp @@ -23,8 +23,6 @@ #include #include -boost::mutex m; - int main() { { @@ -75,4 +73,3 @@ int main() return boost::report_errors(); } - diff --git a/test/sync/futures/future/wait_for_pass.cpp b/test/sync/futures/future/wait_for_pass.cpp index 5f15d4bc5a..e0ec2a6717 100644 --- a/test/sync/futures/future/wait_for_pass.cpp +++ b/test/sync/futures/future/wait_for_pass.cpp @@ -56,13 +56,13 @@ void func1(boost::promise p) p.set_value(3); } -int j = 0; +int g_j = 0; void func3(boost::promise 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 p) diff --git a/test/sync/futures/future/wait_pass.cpp b/test/sync/futures/future/wait_pass.cpp index d66d6b3155..fcdf12cf93 100644 --- a/test/sync/futures/future/wait_pass.cpp +++ b/test/sync/futures/future/wait_pass.cpp @@ -54,13 +54,13 @@ void func1(boost::promise p) p.set_value(3); } -int j = 0; +int g_j = 0; void func3(boost::promise 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 p) diff --git a/test/sync/futures/future/wait_until_pass.cpp b/test/sync/futures/future/wait_until_pass.cpp index acea44e6f2..0457900bc4 100644 --- a/test/sync/futures/future/wait_until_pass.cpp +++ b/test/sync/futures/future/wait_until_pass.cpp @@ -57,13 +57,13 @@ void func1(boost::promise p) p.set_value(3); } -int j = 0; +int g_j = 0; void func3(boost::promise 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 p) diff --git a/test/sync/futures/promise/move_assign_pass.cpp b/test/sync/futures/promise/move_assign_pass.cpp index 0fbee02bbe..d8bdb690b8 100644 --- a/test/sync/futures/promise/move_assign_pass.cpp +++ b/test/sync/futures/promise/move_assign_pass.cpp @@ -26,9 +26,6 @@ #include "../test_allocator.hpp" #endif -boost::mutex m0; -boost::mutex m1; - int main() { #if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS diff --git a/test/sync/futures/promise/move_ctor_pass.cpp b/test/sync/futures/promise/move_ctor_pass.cpp index eaac0ddfef..e9be60645a 100644 --- a/test/sync/futures/promise/move_ctor_pass.cpp +++ b/test/sync/futures/promise/move_ctor_pass.cpp @@ -26,8 +26,6 @@ #include "../test_allocator.hpp" #endif -boost::mutex m; - int main() { #if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS @@ -148,4 +146,3 @@ int main() return boost::report_errors(); } - diff --git a/test/sync/futures/promise/set_lvalue_at_thread_exit_pass.cpp b/test/sync/futures/promise/set_lvalue_at_thread_exit_pass.cpp index ddae1ef316..58f12bc789 100644 --- a/test/sync/futures/promise/set_lvalue_at_thread_exit_pass.cpp +++ b/test/sync/futures/promise/set_lvalue_at_thread_exit_pass.cpp @@ -24,22 +24,22 @@ #include #include -int i = 0; +int g_i = 0; //void func(boost::promise p) -boost::promise p; +boost::promise g_p; void func() { - p.set_value_at_thread_exit(i); - i = 4; + g_p.set_value_at_thread_exit(g_i); + g_i = 4; } int main() { { - //boost::promise p; - boost::future f = p.get_future(); - //boost::thread(func, boost::move(p)).detach(); + //boost::promise g_p; + boost::future f = g_p.get_future(); + //boost::thread(func, boost::move(g_p)).detach(); boost::thread(func).detach(); int r = f.get(); BOOST_TEST(r == 4); diff --git a/test/sync/futures/promise/set_rvalue_at_thread_exit_pass.cpp b/test/sync/futures/promise/set_rvalue_at_thread_exit_pass.cpp index e11546bcf6..b72245d62a 100644 --- a/test/sync/futures/promise/set_rvalue_at_thread_exit_pass.cpp +++ b/test/sync/futures/promise/set_rvalue_at_thread_exit_pass.cpp @@ -25,27 +25,27 @@ #include #include -boost::promise > p; -boost::promise > p2; +boost::promise > g_p; +boost::promise > g_p2; void func() { boost::csbl::unique_ptr uptr(new int(5)); - p.set_value_at_thread_exit(boost::move(uptr)); + g_p.set_value_at_thread_exit(boost::move(uptr)); } void func2() { - p2.set_value_at_thread_exit(boost::csbl::make_unique(5)); + g_p2.set_value_at_thread_exit(boost::csbl::make_unique(5)); } int main() { { - boost::future > f = p.get_future(); + boost::future > f = g_p.get_future(); boost::thread(func).detach(); BOOST_TEST(*f.get() == 5); } { - boost::future > f = p2.get_future(); + boost::future > f = g_p2.get_future(); boost::thread(func2).detach(); BOOST_TEST(*f.get() == 5); } diff --git a/test/sync/futures/promise/set_value_at_thread_exit_const_pass.cpp b/test/sync/futures/promise/set_value_at_thread_exit_const_pass.cpp index 40113102de..41db3033a7 100644 --- a/test/sync/futures/promise/set_value_at_thread_exit_const_pass.cpp +++ b/test/sync/futures/promise/set_value_at_thread_exit_const_pass.cpp @@ -24,25 +24,25 @@ #include #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) -void func(boost::promise p) +void func(boost::promise prom) #else -boost::promise p; +boost::promise prom; void func() #endif { const int i = 5; - p.set_value_at_thread_exit(i); + prom.set_value_at_thread_exit(i); } int main() { { #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) - boost::promise p; - boost::future f = p.get_future(); - boost::thread(func, boost::move(p)).detach(); + boost::promise prom; + boost::future f = prom.get_future(); + boost::thread(func, boost::move(prom)).detach(); #else - boost::future f = p.get_future(); + boost::future f = prom.get_future(); boost::thread(func).detach(); #endif try diff --git a/test/sync/futures/promise/set_value_at_thread_exit_void_pass.cpp b/test/sync/futures/promise/set_value_at_thread_exit_void_pass.cpp index 47ed7bfd99..8bc419d512 100644 --- a/test/sync/futures/promise/set_value_at_thread_exit_void_pass.cpp +++ b/test/sync/futures/promise/set_value_at_thread_exit_void_pass.cpp @@ -23,35 +23,35 @@ #include #include -int i = 0; +int g_i = 0; -boost::promise p; +boost::promise g_p; void func() { - p.set_value_at_thread_exit(); - i = 1; + g_p.set_value_at_thread_exit(); + g_i = 1; } //void func2_mv(BOOST_THREAD_RV_REF(boost::promise) p2) void func2_mv(boost::promise p2) { p2.set_value_at_thread_exit(); - i = 2; + g_i = 2; } void func2(boost::promise *p2) { p2->set_value_at_thread_exit(); - i = 2; + g_i = 2; } int main() { try { - boost::future f = p.get_future(); + boost::future f = g_p.get_future(); boost::thread(func).detach(); f.get(); - BOOST_TEST(i == 1); + BOOST_TEST(g_i == 1); } catch(std::exception& ) @@ -67,10 +67,10 @@ int main() { boost::promise p2; boost::future f = p2.get_future(); - p = boost::move(p2); + g_p = boost::move(p2); boost::thread(func).detach(); f.get(); - BOOST_TEST(i == 1); + BOOST_TEST(g_i == 1); } catch(std::exception& ex) @@ -94,7 +94,7 @@ int main() #endif f.wait(); f.get(); - BOOST_TEST(i == 2); + BOOST_TEST(g_i == 2); } catch(std::exception& ex) { diff --git a/test/sync/futures/shared_future/move_assign_pass.cpp b/test/sync/futures/shared_future/move_assign_pass.cpp index 8dca26d3dd..b71296c154 100644 --- a/test/sync/futures/shared_future/move_assign_pass.cpp +++ b/test/sync/futures/shared_future/move_assign_pass.cpp @@ -23,9 +23,6 @@ #include #include -boost::mutex m0; -boost::mutex m1; - int main() { { diff --git a/test/sync/futures/shared_future/move_ctor_pass.cpp b/test/sync/futures/shared_future/move_ctor_pass.cpp index c131559bd1..c38eb2a4ff 100644 --- a/test/sync/futures/shared_future/move_ctor_pass.cpp +++ b/test/sync/futures/shared_future/move_ctor_pass.cpp @@ -23,8 +23,6 @@ #include #include -boost::mutex m; - int main() { { @@ -75,4 +73,3 @@ int main() return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/locks/lock_guard/adopt_lock_pass.cpp b/test/sync/mutual_exclusion/locks/lock_guard/adopt_lock_pass.cpp index a366a7c1f6..fe999b12ff 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/adopt_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/adopt_lock_pass.cpp @@ -30,50 +30,50 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #endif -boost::mutex m; +boost::mutex g_mutex; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #ifdef BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { - m.lock(); - boost::lock_guard lg(m, boost::adopt_lock); - t1 = Clock::now(); + g_mutex.lock(); + boost::lock_guard lg(g_mutex, boost::adopt_lock); + g_t1 = Clock::now(); } #else - //time_point t0 = Clock::now(); - //time_point t1; + //time_point g_t0 = Clock::now(); + //time_point g_t1; { - m.lock(); - boost::lock_guard lg(m, boost::adopt_lock); - //t1 = Clock::now(); + g_mutex.lock(); + boost::lock_guard lg(g_mutex, boost::adopt_lock); + //g_t1 = Clock::now(); } - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #ifdef BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp index 28eacd525b..b3e20f341c 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp @@ -22,16 +22,14 @@ #include #include -boost::mutex m0; -boost::mutex m1; +boost::mutex g_mutex0; +boost::mutex g_mutex1; int main() { - boost::lock_guard lk0(m0); - boost::lock_guard lk1(m1); + boost::lock_guard lk0(g_mutex0); + boost::lock_guard lk1(g_mutex1); lk1 = lk0; - } #include "../../../../remove_error_code_unused_warning.hpp" - diff --git a/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp index 5eff72a307..c492c28ddb 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp @@ -23,12 +23,11 @@ #include #include -boost::mutex m0; -boost::mutex m1; +boost::mutex g_mutex0; int main() { - boost::lock_guard lk0(m0); + boost::lock_guard lk0(g_mutex0); boost::lock_guard lk1 = lk0; } diff --git a/test/sync/mutual_exclusion/locks/lock_guard/default_pass.cpp b/test/sync/mutual_exclusion/locks/lock_guard/default_pass.cpp index 18a7d2a250..3a4953064c 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/default_pass.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/default_pass.cpp @@ -30,49 +30,49 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #endif -boost::mutex m; +boost::mutex g_mutex; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #ifdef BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { - boost::lock_guard lg(m); - t1 = Clock::now(); + boost::lock_guard lg(g_mutex); + g_t1 = Clock::now(); } #else - //time_point t0 = Clock::now(); - //time_point t1; + //time_point g_t0 = Clock::now(); + //time_point g_t1; { - boost::lock_guard lg(m); - //t1 = Clock::now(); + boost::lock_guard lg(g_mutex); + //g_t1 = Clock::now(); } - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #ifdef BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_fail.cpp b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_fail.cpp index 7e456c0ee5..49bae60cd4 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_fail.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_fail.cpp @@ -13,9 +13,9 @@ #include #include -boost::mutex m; +boost::mutex g_mutex; void fail() { - boost::lock_guard lk(m, boost::adopt_lock); + boost::lock_guard lk(g_mutex, boost::adopt_lock); } diff --git a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_pass.cpp b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_pass.cpp index 57d6ac18d7..c083f56346 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_pass.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_adopt_lock_compile_pass.cpp @@ -13,10 +13,10 @@ #include #include -boost::mutex m; +boost::mutex g_mutex; void pass() { - m.lock(); - boost::lock_guard lk(m, boost::adopt_lock); + g_mutex.lock(); + boost::lock_guard lk(g_mutex, boost::adopt_lock); } diff --git a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_fail.cpp b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_fail.cpp index 921f0b4ef9..6aa3ce0cf0 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_fail.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_fail.cpp @@ -13,10 +13,10 @@ #include #include -boost::mutex m; +boost::mutex g_mutex; void fail() { - boost::lock_guard lk0(m); - boost::lock_guard lk1(m); + boost::lock_guard lk0(g_mutex); + boost::lock_guard lk1(g_mutex); } diff --git a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_pass.cpp b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_pass.cpp index d9a01003a4..afd860a577 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_pass.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/lock_guard_compile_pass.cpp @@ -13,12 +13,12 @@ #include #include -boost::mutex m; +boost::mutex g_mutex; void pass() { { - boost::lock_guard lk0(m); + boost::lock_guard lk0(g_mutex); } - boost::lock_guard lk1(m); + boost::lock_guard lk1(g_mutex); } diff --git a/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_adopt_lock_pass.cpp b/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_adopt_lock_pass.cpp index 806ae293b9..42c35550d4 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_adopt_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_adopt_lock_pass.cpp @@ -32,10 +32,10 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #endif -boost::mutex m; +boost::mutex g_mutex; #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && ! defined BOOST_THREAD_NO_MAKE_LOCK_GUARD @@ -44,22 +44,22 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #ifdef BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { - m.lock(); - auto&& lg = boost::make_lock_guard(m, boost::adopt_lock); (void)lg; + g_mutex.lock(); + auto&& lg = boost::make_lock_guard(g_mutex, boost::adopt_lock); (void)lg; - t1 = Clock::now(); + g_t1 = Clock::now(); } #else - //time_point t0 = Clock::now(); - //time_point t1; + //time_point g_t0 = Clock::now(); + //time_point g_t1; { - m.lock(); - auto&& lg = boost::make_lock_guard(m, boost::adopt_lock); (void)lg; - //t1 = Clock::now(); + g_mutex.lock(); + auto&& lg = boost::make_lock_guard(g_mutex, boost::adopt_lock); (void)lg; + //g_t1 = Clock::now(); } - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } @@ -68,19 +68,19 @@ void f() int main() { #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && ! defined BOOST_THREAD_NO_MAKE_LOCK_GUARD - m.lock(); + g_mutex.lock(); boost::thread t(f); #ifdef BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_pass.cpp b/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_pass.cpp index ec8dacc04d..e56f416155 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_pass.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/make_lock_guard_pass.cpp @@ -32,11 +32,11 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #endif -boost::mutex m; +boost::mutex g_mutex; #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && ! defined BOOST_THREAD_NO_MAKE_LOCK_GUARD && defined BOOST_THREAD_USES_CHRONO @@ -44,10 +44,10 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { - t0 = Clock::now(); + g_t0 = Clock::now(); { - const auto&& lg = boost::make_lock_guard(m); (void)lg; - t1 = Clock::now(); + const auto&& lg = boost::make_lock_guard(g_mutex); (void)lg; + g_t1 = Clock::now(); } } #endif @@ -57,16 +57,16 @@ int main() #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && ! defined BOOST_THREAD_NO_MAKE_LOCK_GUARD && defined BOOST_THREAD_USES_CHRONO { - m.lock(); + g_mutex.lock(); boost::thread t(f); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_assign_fail.cpp index 350310af86..01f279d632 100644 --- a/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_assign_fail.cpp @@ -14,13 +14,13 @@ #include #include -boost::mutex m0; -boost::mutex m1; +boost::mutex g_mutex0; +boost::mutex g_mutex1; int main() { - boost::unique_lock lk0(m0); - boost::unique_lock lk1(m1); + boost::unique_lock lk0(g_mutex0); + boost::unique_lock lk1(g_mutex1); boost::nested_strict_lock > nlk0(lk0); boost::nested_strict_lock > nlk1(lk1); lk1 = lk0; @@ -28,4 +28,3 @@ int main() } #include "../../../../remove_error_code_unused_warning.hpp" - diff --git a/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_ctor_fail.cpp index 6426d7e935..01a626f722 100644 --- a/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_ctor_fail.cpp @@ -15,14 +15,12 @@ #include #include -boost::mutex m0; -boost::mutex m1; +boost::mutex g_mutex0; int main() { - boost::nested_strict_lock > lk0(m0); + boost::nested_strict_lock > lk0(g_mutex0); boost::nested_strict_lock > lk1 = lk0; } #include "../../../../remove_error_code_unused_warning.hpp" - diff --git a/test/sync/mutual_exclusion/locks/nested_strict_lock/default_pass.cpp b/test/sync/mutual_exclusion/locks/nested_strict_lock/default_pass.cpp index fc0b0cd70f..aa05c6dbe5 100644 --- a/test/sync/mutual_exclusion/locks/nested_strict_lock/default_pass.cpp +++ b/test/sync/mutual_exclusion/locks/nested_strict_lock/default_pass.cpp @@ -22,32 +22,32 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #endif -boost::mutex m; +boost::mutex g_mutex; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #ifdef BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); - boost::unique_lock lg(m); + g_t0 = Clock::now(); + boost::unique_lock lg(g_mutex); { boost::nested_strict_lock > nlg(lg); - t1 = Clock::now(); + g_t1 = Clock::now(); } #else - //time_point t0 = Clock::now(); - //time_point t1; - boost::unique_lock lg(m); + //time_point g_t0 = Clock::now(); + //time_point g_t1; + boost::unique_lock lg(g_mutex); { boost::nested_strict_lock > nlg(lg); - //t1 = Clock::now(); + //g_t1 = Clock::now(); } - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } @@ -55,19 +55,19 @@ void f() int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f); #ifdef BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/nested_strict_lock/make_nested_strict_lock_pass.cpp b/test/sync/mutual_exclusion/locks/nested_strict_lock/make_nested_strict_lock_pass.cpp index e47f1e1597..0810e6c8e1 100644 --- a/test/sync/mutual_exclusion/locks/nested_strict_lock/make_nested_strict_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/nested_strict_lock/make_nested_strict_lock_pass.cpp @@ -24,11 +24,11 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #endif -boost::mutex m; +boost::mutex g_mutex; #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && ! defined BOOST_THREAD_NO_MAKE_NESTED_STRICT_LOCK && defined BOOST_THREAD_USES_CHRONO @@ -36,11 +36,11 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { - t0 = Clock::now(); - boost::unique_lock lg(m); + g_t0 = Clock::now(); + boost::unique_lock lg(g_mutex); { const auto&& nlg = boost::make_nested_strict_lock(lg); (void)nlg; - t1 = Clock::now(); + g_t1 = Clock::now(); } } #endif @@ -50,16 +50,16 @@ int main() #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && ! defined BOOST_THREAD_NO_MAKE_NESTED_STRICT_LOCK && defined BOOST_THREAD_USES_CHRONO { - m.lock(); + g_mutex.lock(); boost::thread t(f); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/reverse_lock/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/reverse_lock/copy_ctor_fail.cpp index c936c11b86..7a9c76a932 100644 --- a/test/sync/mutual_exclusion/locks/reverse_lock/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/reverse_lock/copy_ctor_fail.cpp @@ -15,9 +15,6 @@ #include #include -boost::mutex m0; -boost::mutex m1; - int main() { boost::mutex m0; @@ -29,4 +26,3 @@ int main() } #include "../../../../remove_error_code_unused_warning.hpp" - diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_assign_fail.cpp index 34cfec9ed7..ff616fdd86 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_assign_fail.cpp @@ -22,15 +22,15 @@ #include #include -boost::shared_mutex m0; -boost::shared_mutex m1; +boost::shared_mutex g_mutex0; +boost::shared_mutex g_mutex1; int main() { - boost::shared_lock lk0(m0); - boost::shared_lock lk1(m1); + boost::shared_lock lk0(g_mutex0); + boost::shared_lock lk1(g_mutex1); lk1 = lk0; - BOOST_TEST(lk1.mutex() == &m0); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_ctor_fail.cpp index af3e67b278..ce78ba1fc9 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_ctor_fail.cpp @@ -23,18 +23,17 @@ #include #include -boost::shared_mutex m0; -boost::shared_mutex m1; +boost::shared_mutex g_mutex0; +boost::shared_mutex g_mutex1; int main() { - boost::shared_lock lk0(m0); + boost::shared_lock lk0(g_mutex0); boost::shared_lock lk1 = lk0; - BOOST_TEST(lk1.mutex() == &m1); + BOOST_TEST(lk1.mutex() == &g_mutex1); BOOST_TEST(lk1.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } #include "../../../../../remove_error_code_unused_warning.hpp" - diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/duration_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/duration_pass.cpp index 1279ff0151..5ae77d0dc7 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/duration_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/duration_pass.cpp @@ -26,59 +26,59 @@ #include #include "../../../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { - t0 = Clock::now(); - boost::shared_lock lk(m, ms(750)); + g_t0 = Clock::now(); + boost::shared_lock lk(g_mutex, ms(750)); BOOST_TEST(lk.owns_lock() == true); - t1 = Clock::now(); + g_t1 = Clock::now(); } void f2() { - t0 = Clock::now(); - boost::shared_lock lk(m, ms(250)); + g_t0 = Clock::now(); + boost::shared_lock lk(g_mutex, ms(250)); BOOST_TEST(lk.owns_lock() == false); - t1 = Clock::now(); - ns d = t1 - t0 - ms(250); + g_t1 = Clock::now(); + ns d = g_t1 - g_t0 - ms(250); BOOST_THREAD_TEST_IT(d, ns(max_diff)); } int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); BOOST_THREAD_TEST_IT(d_ns, ns(max_diff)); } { - m.lock(); + g_mutex.lock(); boost::thread t(f2); boost::this_thread::sleep_for(ms(750)); - m.unlock(); + g_mutex.unlock(); t.join(); } diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp index 1874580482..6a99e0e747 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp @@ -23,60 +23,56 @@ #include #include -boost::shared_mutex m0; -boost::shared_mutex m1; +boost::shared_mutex g_mutex0; +boost::shared_mutex g_mutex1; int main() { { - boost::shared_lock lk0(m0); - boost::shared_lock lk1(m1); + boost::shared_lock lk0(g_mutex0); + boost::shared_lock lk1(g_mutex1); lk1 = boost::move(lk0); - BOOST_TEST(lk1.mutex() == &m0); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::shared_lock lk1; - lk1 = BOOST_THREAD_MAKE_RV_REF(boost::shared_lock(m0)); - BOOST_TEST(lk1.mutex() == &m0); + lk1 = BOOST_THREAD_MAKE_RV_REF(boost::shared_lock(g_mutex0)); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); } { - boost::unique_lock lk0(m0); - boost::shared_lock lk1(m1); + boost::unique_lock lk0(g_mutex0); + boost::shared_lock lk1(g_mutex1); lk1 = BOOST_THREAD_MAKE_RV_REF(boost::shared_lock(boost::move(lk0))); - BOOST_TEST(lk1.mutex() == &m0); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::shared_lock lk1; - lk1 = BOOST_THREAD_MAKE_RV_REF(boost::shared_lock(boost::unique_lock(m0))); - BOOST_TEST(lk1.mutex() == &m0); + lk1 = BOOST_THREAD_MAKE_RV_REF(boost::shared_lock(boost::unique_lock(g_mutex0))); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); } { - boost::upgrade_lock lk0(m0); - boost::shared_lock lk1(m1); + boost::upgrade_lock lk0(g_mutex0); + boost::shared_lock lk1(g_mutex1); lk1 = BOOST_THREAD_MAKE_RV_REF(boost::shared_lock(boost::move(lk0))); - BOOST_TEST(lk1.mutex() == &m0); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::shared_lock lk1; - lk1 = BOOST_THREAD_MAKE_RV_REF(boost::shared_lock(boost::upgrade_lock(m0))); - BOOST_TEST(lk1.mutex() == &m0); + lk1 = BOOST_THREAD_MAKE_RV_REF(boost::shared_lock(boost::upgrade_lock(g_mutex0))); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); } - return boost::report_errors(); + return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp index d91e1fbf63..a825e0a6c5 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp @@ -23,25 +23,23 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { { - boost::shared_lock lk0(m); - boost::shared_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::shared_lock lk0(g_mutex); + boost::shared_lock lk( (boost::move(lk0))); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::shared_lock lk( (BOOST_THREAD_MAKE_RV_REF(boost::shared_lock(m)))); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); + boost::shared_lock lk( (BOOST_THREAD_MAKE_RV_REF(boost::shared_lock(g_mutex)))); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); } - return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_unique_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_unique_lock_pass.cpp index b9bdb39af5..e98112c784 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_unique_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_unique_lock_pass.cpp @@ -23,43 +23,40 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { - { - boost::unique_lock lk0(m); - boost::shared_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::unique_lock lk0(g_mutex); + boost::shared_lock lk( (boost::move(lk0))); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::shared_lock lk( (boost::unique_lock(m))); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); + boost::shared_lock lk( (boost::unique_lock(g_mutex))); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); } { - boost::unique_lock lk0(m, boost::defer_lock); - boost::shared_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == false); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::unique_lock lk0(g_mutex, boost::defer_lock); + boost::shared_lock lk( (boost::move(lk0))); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == false); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::unique_lock lk0(m, boost::defer_lock); - lk0.release(); - boost::shared_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == 0); - BOOST_TEST(lk.owns_lock() == false); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::unique_lock lk0(g_mutex, boost::defer_lock); + lk0.release(); + boost::shared_lock lk( (boost::move(lk0))); + BOOST_TEST(lk.mutex() == 0); + BOOST_TEST(lk.owns_lock() == false); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } - return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_upgrade_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_upgrade_lock_pass.cpp index b778095db9..da5f9dc903 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_upgrade_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_upgrade_lock_pass.cpp @@ -23,42 +23,40 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { - { - boost::upgrade_lock lk0(m); - boost::shared_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::upgrade_lock lk0(g_mutex); + boost::shared_lock lk( (boost::move(lk0))); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::shared_lock lk( (boost::upgrade_lock(m))); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); + boost::shared_lock lk( (boost::upgrade_lock(g_mutex))); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); } { - boost::upgrade_lock lk0(m, boost::defer_lock); - boost::shared_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == false); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::upgrade_lock lk0(g_mutex, boost::defer_lock); + boost::shared_lock lk( (boost::move(lk0))); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == false); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::upgrade_lock lk0(m, boost::defer_lock); - lk0.release(); - boost::shared_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == 0); - BOOST_TEST(lk.owns_lock() == false); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::upgrade_lock lk0(g_mutex, boost::defer_lock); + lk0.release(); + boost::shared_lock lk( (boost::move(lk0))); + BOOST_TEST(lk.mutex() == 0); + BOOST_TEST(lk.owns_lock() == false); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/mutex_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/mutex_pass.cpp index 0860107a08..5ba87ce831 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/mutex_pass.cpp @@ -24,7 +24,7 @@ #include #include "../../../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -32,8 +32,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -42,26 +42,26 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { - boost::shared_lock ul(m); - t1 = Clock::now(); + boost::shared_lock ul(g_mutex); + g_t1 = Clock::now(); } #else - //time_point t0 = Clock::now(); - //time_point t1; + //time_point g_t0 = Clock::now(); + //time_point g_t1; { - boost::shared_lock ul(m); - //t1 = Clock::now(); + boost::shared_lock ul(g_mutex); + //g_t1 = Clock::now(); } - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -69,12 +69,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/time_point_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/time_point_pass.cpp index 641527349e..5fb1eeb443 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/time_point_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/time_point_pass.cpp @@ -25,59 +25,59 @@ #include #include "../../../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { - t0 = Clock::now(); - boost::shared_lock lk(m, Clock::now() + ms(750)); + g_t0 = Clock::now(); + boost::shared_lock lk(g_mutex, Clock::now() + ms(750)); BOOST_TEST(lk.owns_lock() == true); - t1 = Clock::now(); + g_t1 = Clock::now(); } void f2() { - t0 = Clock::now(); - boost::shared_lock lk(m, Clock::now() + ms(250)); + g_t0 = Clock::now(); + boost::shared_lock lk(g_mutex, Clock::now() + ms(250)); BOOST_TEST(lk.owns_lock() == false); - t1 = Clock::now(); - ns d = t1 - t0 - ms(250); + g_t1 = Clock::now(); + ns d = g_t1 - g_t0 - ms(250); BOOST_THREAD_TEST_IT(d, ns(max_diff)); } int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); BOOST_THREAD_TEST_IT(d_ns, ns(max_diff)); } { - m.lock(); + g_mutex.lock(); boost::thread t(f2); boost::this_thread::sleep_for(ms(750)); - m.unlock(); + g_mutex.unlock(); t.join(); } diff --git a/test/sync/mutual_exclusion/locks/shared_lock/cons/try_to_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/cons/try_to_lock_pass.cpp index e5866110d9..8b702ba4a0 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/cons/try_to_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/cons/try_to_lock_pass.cpp @@ -24,7 +24,7 @@ #include #include "../../../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -32,8 +32,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -42,55 +42,55 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { - boost::shared_lock lk(m, boost::try_to_lock); + boost::shared_lock lk(g_mutex, boost::try_to_lock); BOOST_TEST(lk.owns_lock() == false); } { - boost::shared_lock lk(m, boost::try_to_lock); + boost::shared_lock lk(g_mutex, boost::try_to_lock); BOOST_TEST(lk.owns_lock() == false); } { - boost::shared_lock lk(m, boost::try_to_lock); + boost::shared_lock lk(g_mutex, boost::try_to_lock); BOOST_TEST(lk.owns_lock() == false); } for (;;) { - boost::shared_lock lk(m, boost::try_to_lock); + boost::shared_lock lk(g_mutex, boost::try_to_lock); if (lk.owns_lock()) { - t1 = Clock::now(); + g_t1 = Clock::now(); break; } } #else -// time_point t0 = Clock::now(); +// time_point g_t0 = Clock::now(); // { -// boost::shared_lock lk(m, boost::try_to_lock); +// boost::shared_lock lk(g_mutex, boost::try_to_lock); // BOOST_TEST(lk.owns_lock() == false); // } // { -// boost::shared_lock lk(m, boost::try_to_lock); +// boost::shared_lock lk(g_mutex, boost::try_to_lock); // BOOST_TEST(lk.owns_lock() == false); // } // { -// boost::shared_lock lk(m, boost::try_to_lock); +// boost::shared_lock lk(g_mutex, boost::try_to_lock); // BOOST_TEST(lk.owns_lock() == false); // } for (;;) { - boost::shared_lock lk(m, boost::try_to_lock); + boost::shared_lock lk(g_mutex, boost::try_to_lock); if (lk.owns_lock()) break; } - //time_point t1 = Clock::now(); - //ns d = t1 - t0 - ms(250); + //time_point g_t1 = Clock::now(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -98,12 +98,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/shared_lock/locking/lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/locking/lock_pass.cpp index 65099f44d8..2dbfb6fd7b 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/locking/lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/locking/lock_pass.cpp @@ -25,7 +25,7 @@ #include #include "../../../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -33,8 +33,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -43,10 +43,10 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - boost::shared_lock < boost::shared_mutex > lk(m, boost::defer_lock); - t0 = Clock::now(); + boost::shared_lock < boost::shared_mutex > lk(g_mutex, boost::defer_lock); + g_t0 = Clock::now(); lk.lock(); - t1 = Clock::now(); + g_t1 = Clock::now(); BOOST_TEST(lk.owns_lock() == true); try { @@ -69,12 +69,12 @@ void f() BOOST_TEST(e.code().value() == boost::system::errc::operation_not_permitted); } #else - boost::shared_lock < boost::shared_mutex > lk(m, boost::defer_lock); - //time_point t0 = Clock::now(); + boost::shared_lock < boost::shared_mutex > lk(g_mutex, boost::defer_lock); + //time_point g_t0 = Clock::now(); lk.lock(); - //time_point t1 = Clock::now(); + //time_point g_t1 = Clock::now(); BOOST_TEST(lk.owns_lock() == true); - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); try { @@ -101,7 +101,7 @@ void f() int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -109,12 +109,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_for_pass.cpp index a5997890d4..0ed6ef086a 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_for_pass.cpp @@ -41,11 +41,11 @@ struct shared_mutex } }; -shared_mutex m; +shared_mutex g_mutex; int main() { - boost::shared_lock lk(m, boost::defer_lock); + boost::shared_lock lk(g_mutex, boost::defer_lock); BOOST_TEST(lk.try_lock_for(ms(5)) == true); BOOST_TEST(try_lock_for_called == true); BOOST_TEST(lk.owns_lock() == true); diff --git a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_pass.cpp index 00e4c1a003..d87059dc10 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_pass.cpp @@ -37,11 +37,11 @@ struct shared_mutex } }; -shared_mutex m; +shared_mutex g_mutex; int main() { - boost::shared_lock lk(m, boost::defer_lock); + boost::shared_lock lk(g_mutex, boost::defer_lock); BOOST_TEST(lk.try_lock() == true); BOOST_TEST(try_lock_called == true); BOOST_TEST(lk.owns_lock() == true); diff --git a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp index 44d92c83b0..8d4463a4be 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp @@ -40,12 +40,12 @@ struct shared_mutex } }; -shared_mutex m; +shared_mutex g_mutex; int main() { typedef boost::chrono::steady_clock Clock; - boost::shared_lock lk(m, boost::defer_lock); + boost::shared_lock lk(g_mutex, boost::defer_lock); BOOST_TEST(lk.try_lock_until(Clock::now()) == true); BOOST_TEST(try_lock_until_called == true); BOOST_TEST(lk.owns_lock() == true); diff --git a/test/sync/mutual_exclusion/locks/shared_lock/locking/unlock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/locking/unlock_pass.cpp index 87f34c0d78..e8f528948f 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/locking/unlock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/locking/unlock_pass.cpp @@ -36,11 +36,11 @@ struct shared_mutex } }; -shared_mutex m; +shared_mutex g_mutex; int main() { - boost::shared_lock lk(m); + boost::shared_lock lk(g_mutex); lk.unlock(); BOOST_TEST(unlock_called == true); BOOST_TEST(lk.owns_lock() == false); diff --git a/test/sync/mutual_exclusion/locks/shared_lock/mod/member_swap_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/mod/member_swap_pass.cpp index 65f37e7a9e..4d4a6a1fdb 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/mod/member_swap_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/mod/member_swap_pass.cpp @@ -31,16 +31,16 @@ struct shared_mutex } }; -shared_mutex m; +shared_mutex g_mutex; int main() { - boost::shared_lock lk1(m); + boost::shared_lock lk1(g_mutex); boost::shared_lock lk2; lk1.swap(lk2); BOOST_TEST(lk1.mutex() == 0); BOOST_TEST(lk1.owns_lock() == false); - BOOST_TEST(lk2.mutex() == &m); + BOOST_TEST(lk2.mutex() == &g_mutex); BOOST_TEST(lk2.owns_lock() == true); return boost::report_errors(); diff --git a/test/sync/mutual_exclusion/locks/shared_lock/mod/non_member_swap_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/mod/non_member_swap_pass.cpp index 1b5db8411c..74d277adad 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/mod/non_member_swap_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/mod/non_member_swap_pass.cpp @@ -30,16 +30,16 @@ struct shared_mutex } }; -shared_mutex m; +shared_mutex g_mutex; int main() { - boost::shared_lock lk1(m); + boost::shared_lock lk1(g_mutex); boost::shared_lock lk2; swap(lk1, lk2); BOOST_TEST(lk1.mutex() == 0); BOOST_TEST(lk1.owns_lock() == false); - BOOST_TEST(lk2.mutex() == &m); + BOOST_TEST(lk2.mutex() == &g_mutex); BOOST_TEST(lk2.owns_lock() == true); return boost::report_errors(); diff --git a/test/sync/mutual_exclusion/locks/shared_lock/mod/release_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/mod/release_pass.cpp index d9e2aba2e8..64b65e20c2 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/mod/release_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/mod/release_pass.cpp @@ -38,16 +38,16 @@ struct shared_mutex int shared_mutex::lock_count = 0; int shared_mutex::unlock_count = 0; -shared_mutex m; +shared_mutex g_mutex; int main() { - boost::shared_lock lk(m); - BOOST_TEST(lk.mutex() == &m); + boost::shared_lock lk(g_mutex); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); BOOST_TEST(shared_mutex::lock_count == 1); BOOST_TEST(shared_mutex::unlock_count == 0); - BOOST_TEST(lk.release() == &m); + BOOST_TEST(lk.release() == &g_mutex); BOOST_TEST(lk.mutex() == 0); BOOST_TEST(lk.owns_lock() == false); BOOST_TEST(shared_mutex::lock_count == 1); diff --git a/test/sync/mutual_exclusion/locks/shared_lock/obs/mutex_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/obs/mutex_pass.cpp index 3656f7357f..181f74d3ae 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/obs/mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/obs/mutex_pass.cpp @@ -22,16 +22,16 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { boost::shared_lock lk0; BOOST_TEST(lk0.mutex() == 0); - boost::shared_lock lk1(m); - BOOST_TEST(lk1.mutex() == &m); + boost::shared_lock lk1(g_mutex); + BOOST_TEST(lk1.mutex() == &g_mutex); lk1.unlock(); - BOOST_TEST(lk1.mutex() == &m); + BOOST_TEST(lk1.mutex() == &g_mutex); return boost::report_errors(); } diff --git a/test/sync/mutual_exclusion/locks/shared_lock/obs/op_bool_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/obs/op_bool_pass.cpp index fe8666c459..bd1db334ce 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/obs/op_bool_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/obs/op_bool_pass.cpp @@ -22,13 +22,13 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { boost::shared_lock < boost::shared_mutex > lk0; BOOST_TEST(bool(lk0) == false); - boost::shared_lock < boost::shared_mutex > lk1(m); + boost::shared_lock < boost::shared_mutex > lk1(g_mutex); BOOST_TEST(bool(lk1) == true); lk1.unlock(); BOOST_TEST(bool(lk1) == false); diff --git a/test/sync/mutual_exclusion/locks/shared_lock/obs/owns_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/obs/owns_lock_pass.cpp index a0486f3135..6173b6e11f 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/obs/owns_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/obs/owns_lock_pass.cpp @@ -22,13 +22,13 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { boost::shared_lock lk0; BOOST_TEST(lk0.owns_lock() == false); - boost::shared_lock lk1(m); + boost::shared_lock lk1(g_mutex); BOOST_TEST(lk1.owns_lock() == true); lk1.unlock(); BOOST_TEST(lk1.owns_lock() == false); diff --git a/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp index 0b8197b16d..3f0518112c 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp @@ -30,40 +30,40 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif -boost::shared_mutex m; +boost::shared_mutex g_mutex; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { - m.lock_shared(); - boost::shared_lock_guard lg(m, boost::adopt_lock); - t1 = Clock::now(); + g_mutex.lock_shared(); + boost::shared_lock_guard lg(g_mutex, boost::adopt_lock); + g_t1 = Clock::now(); } #else - //time_point t0 = Clock::now(); - //time_point t1; + //time_point g_t0 = Clock::now(); + //time_point g_t1; { - m.lock_shared(); - boost::shared_lock_guard lg(m, boost::adopt_lock); - //t1 = Clock::now(); + g_mutex.lock_shared(); + boost::shared_lock_guard lg(g_mutex, boost::adopt_lock); + //g_t1 = Clock::now(); } - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -71,12 +71,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp index c5db439703..e61c82e7b7 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp @@ -22,16 +22,14 @@ #include #include -boost::shared_mutex m0; -boost::shared_mutex m1; +boost::shared_mutex g_mutex0; +boost::shared_mutex g_mutex1; int main() { - boost::shared_lock_guard lk0(m0); - boost::shared_lock_guard lk1(m1); + boost::shared_lock_guard lk0(g_mutex0); + boost::shared_lock_guard lk1(g_mutex1); lk1 = lk0; - } #include "../../../../remove_error_code_unused_warning.hpp" - diff --git a/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp index ce39fa55bf..7a98d7103e 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp @@ -23,14 +23,12 @@ #include #include -boost::shared_mutex m0; -boost::shared_mutex m1; +boost::shared_mutex g_mutex0; int main() { - boost::shared_lock_guard lk0(m0); + boost::shared_lock_guard lk0(g_mutex0); boost::shared_lock_guard lk1 = lk0; } #include "../../../../remove_error_code_unused_warning.hpp" - diff --git a/test/sync/mutual_exclusion/locks/shared_lock_guard/default_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock_guard/default_pass.cpp index 76ff543a64..c5c484b7ce 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock_guard/default_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock_guard/default_pass.cpp @@ -31,38 +31,38 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif -boost::shared_mutex m; +boost::shared_mutex g_mutex; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { - boost::shared_lock_guard lg(m); - t1 = Clock::now(); + boost::shared_lock_guard lg(g_mutex); + g_t1 = Clock::now(); } #else - //time_point t0 = Clock::now(); - //time_point t1; + //time_point g_t0 = Clock::now(); + //time_point g_t1; { - boost::shared_lock_guard lg(m); - //t1 = Clock::now(); + boost::shared_lock_guard lg(g_mutex); + //g_t1 = Clock::now(); } - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -70,12 +70,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/strict_lock/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/strict_lock/copy_assign_fail.cpp index af3666a432..4f79f107e5 100644 --- a/test/sync/mutual_exclusion/locks/strict_lock/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/strict_lock/copy_assign_fail.cpp @@ -13,16 +13,14 @@ #include #include -boost::mutex m0; -boost::mutex m1; +boost::mutex g_mutex0; +boost::mutex g_mutex1; int main() { - boost::strict_lock lk0(m0); - boost::strict_lock lk1(m1); + boost::strict_lock lk0(g_mutex0); + boost::strict_lock lk1(g_mutex1); lk1 = lk0; - } #include "../../../../remove_error_code_unused_warning.hpp" - diff --git a/test/sync/mutual_exclusion/locks/strict_lock/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/strict_lock/copy_ctor_fail.cpp index ec1baabb57..27361e3616 100644 --- a/test/sync/mutual_exclusion/locks/strict_lock/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/strict_lock/copy_ctor_fail.cpp @@ -14,12 +14,11 @@ #include #include -boost::mutex m0; -boost::mutex m1; +boost::mutex g_mutex0; int main() { - boost::strict_lock lk0(m0); + boost::strict_lock lk0(g_mutex0); boost::strict_lock lk1 = lk0; } diff --git a/test/sync/mutual_exclusion/locks/strict_lock/default_pass.cpp b/test/sync/mutual_exclusion/locks/strict_lock/default_pass.cpp index cd1bfb56bc..504563fde8 100644 --- a/test/sync/mutual_exclusion/locks/strict_lock/default_pass.cpp +++ b/test/sync/mutual_exclusion/locks/strict_lock/default_pass.cpp @@ -21,49 +21,49 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #endif -boost::mutex m; +boost::mutex g_mutex; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #ifdef BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { - boost::strict_lock lg(m); - t1 = Clock::now(); + boost::strict_lock lg(g_mutex); + g_t1 = Clock::now(); } #else - //time_point t0 = Clock::now(); - //time_point t1; + //time_point g_t0 = Clock::now(); + //time_point g_t1; { - boost::strict_lock lg(m); - //t1 = Clock::now(); + boost::strict_lock lg(g_mutex); + //g_t1 = Clock::now(); } - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #ifdef BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/strict_lock/make_strict_lock_pass.cpp b/test/sync/mutual_exclusion/locks/strict_lock/make_strict_lock_pass.cpp index 72adab31a4..f0e7015c2f 100644 --- a/test/sync/mutual_exclusion/locks/strict_lock/make_strict_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/strict_lock/make_strict_lock_pass.cpp @@ -23,11 +23,11 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #endif -boost::mutex m; +boost::mutex g_mutex; #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && ! defined BOOST_THREAD_NO_MAKE_STRICT_LOCK && defined BOOST_THREAD_USES_CHRONO @@ -35,12 +35,12 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { - t0 = Clock::now(); + g_t0 = Clock::now(); { - const auto&& lg = boost::make_strict_lock(m); (void)lg; - t1 = Clock::now(); + const auto&& lg = boost::make_strict_lock(g_mutex); (void)lg; + g_t1 = Clock::now(); } - ns d = t1 - t0 - ms(250); + ns d = g_t1 - g_t0 - ms(250); BOOST_THREAD_TEST_IT(d, ns(max_diff)); } #endif @@ -50,16 +50,16 @@ int main() #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && ! defined BOOST_THREAD_NO_MAKE_STRICT_LOCK && defined BOOST_THREAD_USES_CHRONO { - m.lock(); + g_mutex.lock(); boost::thread t(f); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_assign_fail.cpp index 3ba4e2a54c..cd21946baf 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_assign_fail.cpp @@ -22,15 +22,15 @@ #include #include -boost::mutex m0; -boost::mutex m1; +boost::mutex g_mutex0; +boost::mutex g_mutex1; int main() { - boost::unique_lock lk0(m0); - boost::unique_lock lk1(m1); + boost::unique_lock lk0(g_mutex0); + boost::unique_lock lk1(g_mutex1); lk1 = lk0; - BOOST_TEST(lk1.mutex() == &m0); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); @@ -38,4 +38,3 @@ int main() } #include "../../../../../remove_error_code_unused_warning.hpp" - diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_ctor_fail.cpp index 9bd7d17e5b..1b17c31bbd 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_ctor_fail.cpp @@ -23,18 +23,17 @@ #include #include -boost::mutex m0; -boost::mutex m1; +boost::mutex g_mutex0; +boost::mutex g_mutex1; int main() { - boost::unique_lock lk0(m0); + boost::unique_lock lk0(g_mutex0); boost::unique_lock lk1 = lk0; - BOOST_TEST(lk1.mutex() == &m1); + BOOST_TEST(lk1.mutex() == &g_mutex1); BOOST_TEST(lk1.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } #include "../../../../../remove_error_code_unused_warning.hpp" - diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/duration_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/duration_pass.cpp index f19be6fa3d..c41c2f0039 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/duration_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/duration_pass.cpp @@ -30,59 +30,59 @@ #if defined BOOST_THREAD_USES_CHRONO -boost::timed_mutex m; +boost::timed_mutex g_mutex; typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { - t0 = Clock::now(); - boost::unique_lock lk(m, ms(750)); + g_t0 = Clock::now(); + boost::unique_lock lk(g_mutex, ms(750)); BOOST_TEST(lk.owns_lock() == true); - t1 = Clock::now(); + g_t1 = Clock::now(); } void f2() { - t0 = Clock::now(); - boost::unique_lock lk(m, ms(250)); + g_t0 = Clock::now(); + boost::unique_lock lk(g_mutex, ms(250)); BOOST_TEST(lk.owns_lock() == false); - t1 = Clock::now(); - ns d = t1 - t0 - ms(250); + g_t1 = Clock::now(); + ns d = g_t1 - g_t0 - ms(250); BOOST_THREAD_TEST_IT(d, ns(max_diff)); } int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); BOOST_THREAD_TEST_IT(d_ns, ns(max_diff)); } { - m.lock(); + g_mutex.lock(); boost::thread t(f2); boost::this_thread::sleep_for(ms(750)); - m.unlock(); + g_mutex.unlock(); t.join(); } diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_mutex_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_mutex_pass.cpp index 53beaddd19..ff9e1366bf 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_mutex_pass.cpp @@ -19,7 +19,7 @@ //#if ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) -boost::mutex m; +boost::mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO @@ -28,8 +28,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -38,7 +38,7 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) auto @@ -46,12 +46,12 @@ void f() boost::unique_lock #endif //&& - _ = boost::make_unique_lock(m); (void)_; - t1 = Clock::now(); + _ = boost::make_unique_lock(g_mutex); (void)_; + g_t1 = Clock::now(); } #else - //time_point t0 = Clock::now(); - //time_point t1; + //time_point g_t0 = Clock::now(); + //time_point g_t1; { #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) auto @@ -59,17 +59,17 @@ void f() boost::unique_lock #endif //&& - _ = boost::make_unique_lock(m); (void)_; - //t1 = Clock::now(); + _ = boost::make_unique_lock(g_mutex); (void)_; + //g_t1 = Clock::now(); } - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -77,12 +77,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_try_to_lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_try_to_lock_pass.cpp index b3d58b0483..8038bbb02d 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_try_to_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_lock_try_to_lock_pass.cpp @@ -17,7 +17,7 @@ #include #include "../../../../../timming.hpp" -boost::mutex m; +boost::mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -25,8 +25,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -36,46 +36,46 @@ void f() { #if defined BOOST_THREAD_USES_CHRONO { - t0 = Clock::now(); + g_t0 = Clock::now(); #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) auto #else boost::unique_lock #endif - lk = boost::make_unique_lock(m, boost::try_to_lock); + lk = boost::make_unique_lock(g_mutex, boost::try_to_lock); BOOST_TEST(lk.owns_lock() == false); - t1 = Clock::now(); - ns d = t1 - t0; + g_t1 = Clock::now(); + ns d = g_t1 - g_t0; BOOST_THREAD_TEST_IT(d, ns(max_diff)); } { - t0 = Clock::now(); + g_t0 = Clock::now(); #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) auto #else boost::unique_lock #endif - lk = boost::make_unique_lock(m, boost::try_to_lock); + lk = boost::make_unique_lock(g_mutex, boost::try_to_lock); BOOST_TEST(lk.owns_lock() == false); - t1 = Clock::now(); - ns d = t1 - t0; + g_t1 = Clock::now(); + ns d = g_t1 - g_t0; BOOST_THREAD_TEST_IT(d, ns(max_diff)); } { - t0 = Clock::now(); + g_t0 = Clock::now(); #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) auto #else boost::unique_lock #endif - lk = boost::make_unique_lock(m, boost::try_to_lock); + lk = boost::make_unique_lock(g_mutex, boost::try_to_lock); BOOST_TEST(lk.owns_lock() == false); - t1 = Clock::now(); - ns d = t1 - t0; + g_t1 = Clock::now(); + ns d = g_t1 - g_t0; BOOST_THREAD_TEST_IT(d, ns(max_diff)); } { - t0 = Clock::now(); + g_t0 = Clock::now(); for (;;) { #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) @@ -83,25 +83,25 @@ void f() #else boost::unique_lock #endif - lk = boost::make_unique_lock(m, boost::try_to_lock); + lk = boost::make_unique_lock(g_mutex, boost::try_to_lock); if (lk.owns_lock()) { - t1 = Clock::now(); + g_t1 = Clock::now(); break; } } } #else -// time_point t0 = Clock::now(); +// time_point g_t0 = Clock::now(); // { -// boost::unique_lock lk(m, boost::try_to_lock); +// boost::unique_lock lk(g_mutex, boost::try_to_lock); // BOOST_TEST(lk.owns_lock() == false); // } // { -// boost::unique_lock lk(m, boost::try_to_lock); +// boost::unique_lock lk(g_mutex, boost::try_to_lock); // BOOST_TEST(lk.owns_lock() == false); // } // { -// boost::unique_lock lk(m, boost::try_to_lock); +// boost::unique_lock lk(g_mutex, boost::try_to_lock); // BOOST_TEST(lk.owns_lock() == false); // } for (;;) @@ -111,18 +111,18 @@ void f() #else boost::unique_lock #endif - lk = boost::make_unique_lock(m, boost::try_to_lock); + lk = boost::make_unique_lock(g_mutex, boost::try_to_lock); if (lk.owns_lock()) break; } - //time_point t1 = Clock::now(); - //ns d = t1 - t0 - ms(250); + //time_point g_t1 = Clock::now(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -130,12 +130,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_locks_mutex_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_locks_mutex_pass.cpp index ee6645244f..3d0dcc28fb 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_locks_mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/make_unique_locks_mutex_pass.cpp @@ -18,9 +18,9 @@ #if ! defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && ! defined BOOST_THREAD_NO_MAKE_UNIQUE_LOCKS && ! defined BOOST_NO_CXX11_RVALUE_REFERENCES -boost::mutex m1; -boost::mutex m2; -boost::mutex m3; +boost::mutex g_mutex1; +boost::mutex g_mutex2; +boost::mutex g_mutex3; #if defined BOOST_THREAD_USES_CHRONO @@ -30,8 +30,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -40,28 +40,28 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { - auto&& _ = boost::make_unique_locks(m1,m2,m3); (void)_; - t1 = Clock::now(); + auto&& _ = boost::make_unique_locks(g_mutex1,g_mutex2,g_mutex3); (void)_; + g_t1 = Clock::now(); } #else - //time_point t0 = Clock::now(); - //time_point t1; + //time_point g_t0 = Clock::now(); + //time_point g_t1; { - auto&& _ = boost::make_unique_locks(m1,m2,m3); (void)_; - //t1 = Clock::now(); + auto&& _ = boost::make_unique_locks(g_mutex1,g_mutex2,g_mutex3); (void)_; + //g_t1 = Clock::now(); } - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m1.lock(); - m2.lock(); - m3.lock(); + g_mutex1.lock(); + g_mutex2.lock(); + g_mutex3.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -69,14 +69,14 @@ int main() time_point t3 = Clock::now(); #else #endif - m1.unlock(); - m2.unlock(); - m3.unlock(); + g_mutex1.unlock(); + g_mutex2.unlock(); + g_mutex3.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp index 25ecd5ff2f..163cf54f31 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp @@ -23,30 +23,26 @@ #include #include -boost::mutex m0; -boost::mutex m1; +boost::mutex g_mutex0; +boost::mutex g_mutex1; int main() { { - boost::unique_lock lk0(m0); - boost::unique_lock lk1(m1); + boost::unique_lock lk0(g_mutex0); + boost::unique_lock lk1(g_mutex1); lk1 = boost::move(lk0); - BOOST_TEST(lk1.mutex() == &m0); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } - - { - boost::unique_lock lk1; - lk1 = BOOST_THREAD_MAKE_RV_REF(boost::unique_lock(m0)); - BOOST_TEST(lk1.mutex() == &m0); + lk1 = BOOST_THREAD_MAKE_RV_REF(boost::unique_lock(g_mutex0)); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); } - return boost::report_errors(); + return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp index 738bd2bad0..ce9d8a557e 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp @@ -23,33 +23,33 @@ #include #include -boost::mutex m; +boost::mutex g_mutex; int main() { { - boost::unique_lock lk0(m); + boost::unique_lock lk0(g_mutex); boost::unique_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::unique_lock lk( (BOOST_THREAD_MAKE_RV_REF(boost::unique_lock(m)))); - BOOST_TEST(lk.mutex() == &m); + boost::unique_lock lk( (BOOST_THREAD_MAKE_RV_REF(boost::unique_lock(g_mutex)))); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); } { - boost::unique_lock lk0(m, boost::defer_lock); + boost::unique_lock lk0(g_mutex, boost::defer_lock); boost::unique_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == false); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::unique_lock lk0(m, boost::defer_lock); + boost::unique_lock lk0(g_mutex, boost::defer_lock); lk0.release(); boost::unique_lock lk( (boost::move(lk0))); BOOST_TEST(lk.mutex() == 0); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_for_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_for_pass.cpp index 7a728e6013..84ae7b1a09 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_for_pass.cpp @@ -28,34 +28,34 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { { - boost::shared_lock lk0(m); + boost::shared_lock lk0(g_mutex); boost::unique_lock lk(boost::move(lk0), boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { boost::unique_lock - lk(boost::shared_lock(m), boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + lk(boost::shared_lock(g_mutex), boost::chrono::milliseconds(1)); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); } { - boost::shared_lock lk0(m, boost::defer_lock); + boost::shared_lock lk0(g_mutex, boost::defer_lock); boost::unique_lock lk(boost::move(lk0), boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == false); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::shared_lock lk0(m, boost::defer_lock); + boost::shared_lock lk0(g_mutex, boost::defer_lock); lk0.release(); boost::unique_lock lk(boost::move(lk0), boost::chrono::milliseconds(1)); BOOST_TEST(lk.mutex() == 0); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_try_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_try_pass.cpp index 859af72596..35db880786 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_try_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_try_pass.cpp @@ -26,41 +26,40 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { { - boost::shared_lock lk0(m); - boost::unique_lock lk(boost::move(lk0), boost::try_to_lock ); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::shared_lock lk0(g_mutex); + boost::unique_lock lk(boost::move(lk0), boost::try_to_lock ); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::unique_lock lk(boost::shared_lock(m), boost::try_to_lock); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); + boost::unique_lock lk(boost::shared_lock(g_mutex), boost::try_to_lock); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); } { - boost::shared_lock lk0(m, boost::defer_lock); - boost::unique_lock lk(boost::move(lk0), boost::try_to_lock); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == false); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::shared_lock lk0(g_mutex, boost::defer_lock); + boost::unique_lock lk(boost::move(lk0), boost::try_to_lock); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == false); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::shared_lock lk0(m, boost::defer_lock); - lk0.release(); - boost::unique_lock lk(boost::move(lk0), boost::try_to_lock); - BOOST_TEST(lk.mutex() == 0); - BOOST_TEST(lk.owns_lock() == false); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::shared_lock lk0(g_mutex, boost::defer_lock); + lk0.release(); + boost::unique_lock lk(boost::move(lk0), boost::try_to_lock); + BOOST_TEST(lk.mutex() == 0); + BOOST_TEST(lk.owns_lock() == false); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_until_pass.cpp index 319650ee1a..b9b60c1db8 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_until_pass.cpp @@ -28,34 +28,34 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { { - boost::shared_lock lk0(m); + boost::shared_lock lk0(g_mutex); boost::unique_lock lk( boost::move(lk0), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { boost::unique_lock - lk( boost::shared_lock(m), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + lk( boost::shared_lock(g_mutex), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); } { - boost::shared_lock lk0(m, boost::defer_lock); + boost::shared_lock lk0(g_mutex, boost::defer_lock); boost::unique_lock lk( boost::move(lk0), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == false); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::shared_lock lk0(m, boost::defer_lock); + boost::shared_lock lk0(g_mutex, boost::defer_lock); lk0.release(); boost::unique_lock lk( boost::move(lk0), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); BOOST_TEST(lk.mutex() == 0); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_for_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_for_pass.cpp index 33028f7313..0c258fd830 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_for_pass.cpp @@ -26,34 +26,34 @@ #include #include -boost::upgrade_mutex m; +boost::upgrade_mutex g_mutex; int main() { { - boost::upgrade_lock lk0(m); + boost::upgrade_lock lk0(g_mutex); boost::unique_lock lk(boost::move(lk0), boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { boost::unique_lock - lk(boost::upgrade_lock(m), boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + lk(boost::upgrade_lock(g_mutex), boost::chrono::milliseconds(1)); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); } { - boost::upgrade_lock lk0(m, boost::defer_lock); + boost::upgrade_lock lk0(g_mutex, boost::defer_lock); boost::unique_lock lk(boost::move(lk0), boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == false); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::upgrade_lock lk0(m, boost::defer_lock); + boost::upgrade_lock lk0(g_mutex, boost::defer_lock); lk0.release(); boost::unique_lock lk(boost::move(lk0), boost::chrono::milliseconds(1)); BOOST_TEST(lk.mutex() == 0); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp index 91d30537f4..944075c068 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp @@ -23,39 +23,39 @@ #include #include -boost::upgrade_mutex m; +boost::upgrade_mutex g_mutex; int main() { { - boost::upgrade_lock lk0(m); - boost::unique_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::upgrade_lock lk0(g_mutex); + boost::unique_lock lk( (boost::move(lk0))); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::unique_lock lk( (BOOST_THREAD_MAKE_RV_REF(boost::upgrade_lock(m)))); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); + boost::unique_lock lk( (BOOST_THREAD_MAKE_RV_REF(boost::upgrade_lock(g_mutex)))); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); } { - boost::upgrade_lock lk0(m, boost::defer_lock); - boost::unique_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == false); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::upgrade_lock lk0(g_mutex, boost::defer_lock); + boost::unique_lock lk( (boost::move(lk0))); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == false); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::upgrade_lock lk0(m, boost::defer_lock); - lk0.release(); - boost::unique_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == 0); - BOOST_TEST(lk.owns_lock() == false); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::upgrade_lock lk0(g_mutex, boost::defer_lock); + lk0.release(); + boost::unique_lock lk( (boost::move(lk0))); + BOOST_TEST(lk.mutex() == 0); + BOOST_TEST(lk.owns_lock() == false); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } return boost::report_errors(); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_try_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_try_pass.cpp index d788f1c402..6948fabb4b 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_try_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_try_pass.cpp @@ -24,41 +24,40 @@ #include #include -boost::upgrade_mutex m; +boost::upgrade_mutex g_mutex; int main() { { - boost::upgrade_lock lk0(m); - boost::unique_lock lk(boost::move(lk0), boost::try_to_lock ); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::upgrade_lock lk0(g_mutex); + boost::unique_lock lk(boost::move(lk0), boost::try_to_lock ); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::unique_lock lk(boost::upgrade_lock(m), boost::try_to_lock); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); + boost::unique_lock lk(boost::upgrade_lock(g_mutex), boost::try_to_lock); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); } { - boost::upgrade_lock lk0(m, boost::defer_lock); - boost::unique_lock lk(boost::move(lk0), boost::try_to_lock); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == false); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::upgrade_lock lk0(g_mutex, boost::defer_lock); + boost::unique_lock lk(boost::move(lk0), boost::try_to_lock); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == false); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::upgrade_lock lk0(m, boost::defer_lock); - lk0.release(); - boost::unique_lock lk(boost::move(lk0), boost::try_to_lock); - BOOST_TEST(lk.mutex() == 0); - BOOST_TEST(lk.owns_lock() == false); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::upgrade_lock lk0(g_mutex, boost::defer_lock); + lk0.release(); + boost::unique_lock lk(boost::move(lk0), boost::try_to_lock); + BOOST_TEST(lk.mutex() == 0); + BOOST_TEST(lk.owns_lock() == false); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_until_pass.cpp index c3c80d0702..c0467b2de6 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_until_pass.cpp @@ -26,34 +26,34 @@ #include #include -boost::upgrade_mutex m; +boost::upgrade_mutex g_mutex; int main() { { - boost::upgrade_lock lk0(m); + boost::upgrade_lock lk0(g_mutex); boost::unique_lock lk( boost::move(lk0), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { boost::unique_lock - lk( boost::upgrade_lock(m), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + lk( boost::upgrade_lock(g_mutex), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); } { - boost::upgrade_lock lk0(m, boost::defer_lock); + boost::upgrade_lock lk0(g_mutex, boost::defer_lock); boost::unique_lock lk( boost::move(lk0), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == false); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::upgrade_lock lk0(m, boost::defer_lock); + boost::upgrade_lock lk0(g_mutex, boost::defer_lock); lk0.release(); boost::unique_lock lk( boost::move(lk0), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); BOOST_TEST(lk.mutex() == 0); @@ -64,4 +64,3 @@ int main() return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/mutex_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/mutex_pass.cpp index f8a5d6fad7..93c95ededb 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/mutex_pass.cpp @@ -27,7 +27,7 @@ #include "../../../../../timming.hpp" -boost::mutex m; +boost::mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -35,8 +35,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -45,26 +45,26 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { - boost::unique_lock ul(m); - t1 = Clock::now(); + boost::unique_lock ul(g_mutex); + g_t1 = Clock::now(); } #else - //time_point t0 = Clock::now(); - //time_point t1; + //time_point g_t0 = Clock::now(); + //time_point g_t1; { - boost::unique_lock ul(m); - //t1 = Clock::now(); + boost::unique_lock ul(g_mutex); + //g_t1 = Clock::now(); } - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -72,12 +72,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/time_point_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/time_point_pass.cpp index 47bd9428b2..8286208637 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/time_point_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/time_point_pass.cpp @@ -29,59 +29,59 @@ #if defined BOOST_THREAD_USES_CHRONO -boost::timed_mutex m; +boost::timed_mutex g_mutex; typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { - t0 = Clock::now(); - boost::unique_lock lk(m, Clock::now() + ms(750)); + g_t0 = Clock::now(); + boost::unique_lock lk(g_mutex, Clock::now() + ms(750)); BOOST_TEST(lk.owns_lock() == true); - t1 = Clock::now(); + g_t1 = Clock::now(); } void f2() { - t0 = Clock::now(); - boost::unique_lock lk(m, Clock::now() + ms(250)); + g_t0 = Clock::now(); + boost::unique_lock lk(g_mutex, Clock::now() + ms(250)); BOOST_TEST(lk.owns_lock() == false); - t1 = Clock::now(); - ns d = t1 - t0 - ms(250); + g_t1 = Clock::now(); + ns d = g_t1 - g_t0 - ms(250); BOOST_TEST(d < max_diff); } int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); BOOST_THREAD_TEST_IT(d_ns, ns(max_diff)); } { - m.lock(); + g_mutex.lock(); boost::thread t(f2); boost::this_thread::sleep_for(ms(750)); - m.unlock(); + g_mutex.unlock(); t.join(); } diff --git a/test/sync/mutual_exclusion/locks/unique_lock/cons/try_to_lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/cons/try_to_lock_pass.cpp index 3297515c2a..4d74eb4b7c 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/cons/try_to_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/cons/try_to_lock_pass.cpp @@ -26,7 +26,7 @@ #include "../../../../../timming.hpp" -boost::mutex m; +boost::mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -34,8 +34,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -44,56 +44,56 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { - boost::unique_lock lk(m, boost::try_to_lock); + boost::unique_lock lk(g_mutex, boost::try_to_lock); BOOST_TEST(lk.owns_lock() == false); } { - boost::unique_lock lk(m, boost::try_to_lock); + boost::unique_lock lk(g_mutex, boost::try_to_lock); BOOST_TEST(lk.owns_lock() == false); } { - boost::unique_lock lk(m, boost::try_to_lock); + boost::unique_lock lk(g_mutex, boost::try_to_lock); BOOST_TEST(lk.owns_lock() == false); } for (;;) { - boost::unique_lock lk(m, boost::try_to_lock); + boost::unique_lock lk(g_mutex, boost::try_to_lock); if (lk.owns_lock()) { - t1 = Clock::now(); + g_t1 = Clock::now(); break; } } - //m.unlock(); + //g_mutex.unlock(); #else -// time_point t0 = Clock::now(); +// time_point g_t0 = Clock::now(); // { -// boost::unique_lock lk(m, boost::try_to_lock); +// boost::unique_lock lk(g_mutex, boost::try_to_lock); // BOOST_TEST(lk.owns_lock() == false); // } // { -// boost::unique_lock lk(m, boost::try_to_lock); +// boost::unique_lock lk(g_mutex, boost::try_to_lock); // BOOST_TEST(lk.owns_lock() == false); // } // { -// boost::unique_lock lk(m, boost::try_to_lock); +// boost::unique_lock lk(g_mutex, boost::try_to_lock); // BOOST_TEST(lk.owns_lock() == false); // } for (;;) { - boost::unique_lock lk(m, boost::try_to_lock); + boost::unique_lock lk(g_mutex, boost::try_to_lock); if (lk.owns_lock()) break; } - //time_point t1 = Clock::now(); - //ns d = t1 - t0 - ms(250); + //time_point g_t1 = Clock::now(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -101,12 +101,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); std::cout << "d_ns: " << d_ns.count() << std::endl; std::cout << "d_ms: " << d_ms.count() << std::endl; diff --git a/test/sync/mutual_exclusion/locks/unique_lock/locking/lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/locking/lock_pass.cpp index 510de661ed..c67be07ba5 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/locking/lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/locking/lock_pass.cpp @@ -25,7 +25,7 @@ #include #include "../../../../../timming.hpp" -boost::mutex m; +boost::mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -33,8 +33,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -43,10 +43,10 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - boost::unique_lock < boost::mutex > lk(m, boost::defer_lock); - t0 = Clock::now(); + boost::unique_lock < boost::mutex > lk(g_mutex, boost::defer_lock); + g_t0 = Clock::now(); lk.lock(); - t1 = Clock::now(); + g_t1 = Clock::now(); BOOST_TEST(lk.owns_lock() == true); try { @@ -69,12 +69,12 @@ void f() BOOST_TEST(e.code().value() == boost::system::errc::operation_not_permitted); } #else - boost::unique_lock < boost::mutex > lk(m, boost::defer_lock); - //time_point t0 = Clock::now(); + boost::unique_lock < boost::mutex > lk(g_mutex, boost::defer_lock); + //time_point g_t0 = Clock::now(); lk.lock(); - //time_point t1 = Clock::now(); + //time_point g_t1 = Clock::now(); BOOST_TEST(lk.owns_lock() == true); - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); try { @@ -101,7 +101,7 @@ void f() int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -109,12 +109,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_for_pass.cpp index 9ee4f88dcf..172d78bb03 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_for_pass.cpp @@ -44,11 +44,11 @@ struct mutex } }; -mutex m; +mutex g_mutex; int main() { - boost::unique_lock lk(m, boost::defer_lock); + boost::unique_lock lk(g_mutex, boost::defer_lock); BOOST_TEST(lk.try_lock_for(ms(5)) == true); BOOST_TEST(try_lock_for_called == true); BOOST_TEST(lk.owns_lock() == true); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_pass.cpp index 47c5ffb222..3d40d4ca6d 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_pass.cpp @@ -37,11 +37,11 @@ struct mutex } }; -mutex m; +mutex g_mutex; int main() { - boost::unique_lock lk(m, boost::defer_lock); + boost::unique_lock lk(g_mutex, boost::defer_lock); BOOST_TEST(lk.try_lock() == true); BOOST_TEST(try_lock_called == true); BOOST_TEST(lk.owns_lock() == true); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp index 90e80aadca..ad9e224dc4 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp @@ -43,12 +43,12 @@ struct mutex } }; -mutex m; +mutex g_mutex; int main() { typedef boost::chrono::steady_clock Clock; - boost::unique_lock lk(m, boost::defer_lock); + boost::unique_lock lk(g_mutex, boost::defer_lock); BOOST_TEST(lk.try_lock_until(Clock::now()) == true); BOOST_TEST(try_lock_until_called == true); BOOST_TEST(lk.owns_lock() == true); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/locking/unlock_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/locking/unlock_pass.cpp index fa20757f6c..96e9c265b7 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/locking/unlock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/locking/unlock_pass.cpp @@ -36,11 +36,11 @@ struct mutex } }; -mutex m; +mutex g_mutex; int main() { - boost::unique_lock lk(m); + boost::unique_lock lk(g_mutex); lk.unlock(); BOOST_TEST(unlock_called == true); BOOST_TEST(lk.owns_lock() == false); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/mod/member_swap_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/mod/member_swap_pass.cpp index f4b32836ae..470600bf5f 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/mod/member_swap_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/mod/member_swap_pass.cpp @@ -31,16 +31,16 @@ struct mutex } }; -mutex m; +mutex g_mutex; int main() { - boost::unique_lock lk1(m); + boost::unique_lock lk1(g_mutex); boost::unique_lock lk2; lk1.swap(lk2); BOOST_TEST(lk1.mutex() == 0); BOOST_TEST(lk1.owns_lock() == false); - BOOST_TEST(lk2.mutex() == &m); + BOOST_TEST(lk2.mutex() == &g_mutex); BOOST_TEST(lk2.owns_lock() == true); return boost::report_errors(); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/mod/non_member_swap_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/mod/non_member_swap_pass.cpp index b7b69cb855..405c646caf 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/mod/non_member_swap_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/mod/non_member_swap_pass.cpp @@ -30,16 +30,16 @@ struct mutex } }; -mutex m; +mutex g_mutex; int main() { - boost::unique_lock lk1(m); + boost::unique_lock lk1(g_mutex); boost::unique_lock lk2; swap(lk1, lk2); BOOST_TEST(lk1.mutex() == 0); BOOST_TEST(lk1.owns_lock() == false); - BOOST_TEST(lk2.mutex() == &m); + BOOST_TEST(lk2.mutex() == &g_mutex); BOOST_TEST(lk2.owns_lock() == true); return boost::report_errors(); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/mod/release_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/mod/release_pass.cpp index fe9715da21..6e359cbb51 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/mod/release_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/mod/release_pass.cpp @@ -38,16 +38,16 @@ struct mutex int mutex::lock_count = 0; int mutex::unlock_count = 0; -mutex m; +mutex g_mutex; int main() { - boost::unique_lock lk(m); - BOOST_TEST(lk.mutex() == &m); + boost::unique_lock lk(g_mutex); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); BOOST_TEST(mutex::lock_count == 1); BOOST_TEST(mutex::unlock_count == 0); - BOOST_TEST(lk.release() == &m); + BOOST_TEST(lk.release() == &g_mutex); BOOST_TEST(lk.mutex() == 0); BOOST_TEST(lk.owns_lock() == false); BOOST_TEST(mutex::lock_count == 1); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/obs/mutex_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/obs/mutex_pass.cpp index 5d5949a8d8..a615773a0a 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/obs/mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/obs/mutex_pass.cpp @@ -22,16 +22,16 @@ #include #include -boost::mutex m; +boost::mutex g_mutex; int main() { boost::unique_lock lk0; BOOST_TEST(lk0.mutex() == 0); - boost::unique_lock lk1(m); - BOOST_TEST(lk1.mutex() == &m); + boost::unique_lock lk1(g_mutex); + BOOST_TEST(lk1.mutex() == &g_mutex); lk1.unlock(); - BOOST_TEST(lk1.mutex() == &m); + BOOST_TEST(lk1.mutex() == &g_mutex); return boost::report_errors(); } diff --git a/test/sync/mutual_exclusion/locks/unique_lock/obs/op_bool_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/obs/op_bool_pass.cpp index c56fabdbdc..289aa23fb8 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/obs/op_bool_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/obs/op_bool_pass.cpp @@ -22,14 +22,14 @@ #include #include -boost::mutex m; +boost::mutex g_mutex; int main() { { boost::unique_lock lk0; BOOST_TEST(bool(lk0) == false); - boost::unique_lock lk1(m); + boost::unique_lock lk1(g_mutex); BOOST_TEST(bool(lk1) == true); lk1.unlock(); BOOST_TEST(bool(lk1) == false); @@ -38,7 +38,7 @@ int main() { boost::unique_lock lk0; if (lk0) BOOST_TEST(false); - boost::unique_lock lk1(m); + boost::unique_lock lk1(g_mutex); if (!lk1) BOOST_TEST(false); lk1.unlock(); if (lk1) BOOST_TEST(false); diff --git a/test/sync/mutual_exclusion/locks/unique_lock/obs/op_int_fail.cpp b/test/sync/mutual_exclusion/locks/unique_lock/obs/op_int_fail.cpp index 733c7daa90..7bb2cb2833 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/obs/op_int_fail.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/obs/op_int_fail.cpp @@ -22,8 +22,6 @@ #include #include -boost::mutex m; - int main() { { diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_assign_fail.cpp index e1a0f9f38c..f26ff90c3f 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_assign_fail.cpp @@ -22,15 +22,15 @@ #include #include -boost::shared_mutex m0; -boost::shared_mutex m1; +boost::shared_mutex g_mutex0; +boost::shared_mutex g_mutex1; int main() { - boost::upgrade_lock lk0(m0); - boost::upgrade_lock lk1(m1); + boost::upgrade_lock lk0(g_mutex0); + boost::upgrade_lock lk1(g_mutex1); lk1 = lk0; - BOOST_TEST(lk1.mutex() == &m0); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); @@ -38,4 +38,3 @@ int main() } #include "../../../../../remove_error_code_unused_warning.hpp" - diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_ctor_fail.cpp index 1ddbf5200b..bc166d9af1 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_ctor_fail.cpp @@ -23,14 +23,14 @@ #include #include -boost::shared_mutex m0; -boost::shared_mutex m1; +boost::shared_mutex g_mutex0; +boost::shared_mutex g_mutex1; int main() { - boost::upgrade_lock lk0(m0); + boost::upgrade_lock lk0(g_mutex0); boost::upgrade_lock lk1(lk0); - BOOST_TEST(lk1.mutex() == &m1); + BOOST_TEST(lk1.mutex() == &g_mutex1); BOOST_TEST(lk1.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/duration_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/duration_pass.cpp index 59882d2c02..804f0f5384 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/duration_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/duration_pass.cpp @@ -28,62 +28,61 @@ #include #include "../../../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { - t0 = Clock::now(); - boost::upgrade_lock lk(m, ms(750)); + g_t0 = Clock::now(); + boost::upgrade_lock lk(g_mutex, ms(750)); BOOST_TEST(lk.owns_lock() == true); - t1 = Clock::now(); + g_t1 = Clock::now(); } void f2() { - t0 = Clock::now(); - boost::upgrade_lock lk(m, ms(250)); + g_t0 = Clock::now(); + boost::upgrade_lock lk(g_mutex, ms(250)); BOOST_TEST(lk.owns_lock() == false); - t1 = Clock::now(); - ns d = t1 - t0 - ms(250); + g_t1 = Clock::now(); + ns d = g_t1 - g_t0 - ms(250); BOOST_THREAD_TEST_IT(d, ns(max_diff)); } int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); BOOST_THREAD_TEST_IT(d_ns, ns(max_diff)); } { - m.lock(); + g_mutex.lock(); boost::thread t(f2); boost::this_thread::sleep_for(ms(750)); - m.unlock(); + g_mutex.unlock(); t.join(); } return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp index 8f91b84a2c..d642c33eaf 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp @@ -23,44 +23,41 @@ #include #include -boost::shared_mutex m0; -boost::shared_mutex m1; +boost::shared_mutex g_mutex0; +boost::shared_mutex g_mutex1; int main() { { - boost::upgrade_lock lk0(m0); - boost::upgrade_lock lk1(m1); + boost::upgrade_lock lk0(g_mutex0); + boost::upgrade_lock lk1(g_mutex1); lk1 = boost::move(lk0); - BOOST_TEST(lk1.mutex() == &m0); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::upgrade_lock lk1; - lk1 = BOOST_THREAD_MAKE_RV_REF(boost::upgrade_lock(m0)); - BOOST_TEST(lk1.mutex() == &m0); + lk1 = BOOST_THREAD_MAKE_RV_REF(boost::upgrade_lock(g_mutex0)); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); } { - boost::unique_lock lk0(m0); - boost::upgrade_lock lk1(m1); + boost::unique_lock lk0(g_mutex0); + boost::upgrade_lock lk1(g_mutex1); lk1 = BOOST_THREAD_MAKE_RV_REF(boost::upgrade_lock(boost::move(lk0))); - BOOST_TEST(lk1.mutex() == &m0); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::upgrade_lock lk1; - lk1 = BOOST_THREAD_MAKE_RV_REF(boost::upgrade_lock(boost::unique_lock(m0))); - BOOST_TEST(lk1.mutex() == &m0); + lk1 = BOOST_THREAD_MAKE_RV_REF(boost::upgrade_lock(boost::unique_lock(g_mutex0))); + BOOST_TEST(lk1.mutex() == &g_mutex0); BOOST_TEST(lk1.owns_lock() == true); } - return boost::report_errors(); + return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp index 300e771d0c..9151e1445c 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp @@ -23,21 +23,21 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { { - boost::upgrade_lock lk0(m); + boost::upgrade_lock lk0(g_mutex); boost::upgrade_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::upgrade_lock lk( (BOOST_THREAD_MAKE_RV_REF(boost::upgrade_lock(m)))); - BOOST_TEST(lk.mutex() == &m); + boost::upgrade_lock lk( (BOOST_THREAD_MAKE_RV_REF(boost::upgrade_lock(g_mutex)))); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); } diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_for_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_for_pass.cpp index 2246fa2f30..e0e7e054e7 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_for_pass.cpp @@ -28,34 +28,34 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { { - boost::shared_lock lk0(m); + boost::shared_lock lk0(g_mutex); boost::upgrade_lock lk(boost::move(lk0), boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { boost::upgrade_lock - lk(boost::shared_lock(m), boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + lk(boost::shared_lock(g_mutex), boost::chrono::milliseconds(1)); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); } { - boost::shared_lock lk0(m, boost::defer_lock); + boost::shared_lock lk0(g_mutex, boost::defer_lock); boost::upgrade_lock lk(boost::move(lk0), boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == false); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::shared_lock lk0(m, boost::defer_lock); + boost::shared_lock lk0(g_mutex, boost::defer_lock); lk0.release(); boost::upgrade_lock lk(boost::move(lk0), boost::chrono::milliseconds(1)); BOOST_TEST(lk.mutex() == 0); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_try_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_try_pass.cpp index 5181bed7c5..429043d861 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_try_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_try_pass.cpp @@ -26,41 +26,40 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { { - boost::shared_lock lk0(m); - boost::upgrade_lock lk(boost::move(lk0), boost::try_to_lock ); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::shared_lock lk0(g_mutex); + boost::upgrade_lock lk(boost::move(lk0), boost::try_to_lock ); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::upgrade_lock lk(boost::shared_lock(m), boost::try_to_lock); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); + boost::upgrade_lock lk(boost::shared_lock(g_mutex), boost::try_to_lock); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); } { - boost::shared_lock lk0(m, boost::defer_lock); - boost::upgrade_lock lk(boost::move(lk0), boost::try_to_lock); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == false); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::shared_lock lk0(g_mutex, boost::defer_lock); + boost::upgrade_lock lk(boost::move(lk0), boost::try_to_lock); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == false); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::shared_lock lk0(m, boost::defer_lock); - lk0.release(); - boost::upgrade_lock lk(boost::move(lk0), boost::try_to_lock); - BOOST_TEST(lk.mutex() == 0); - BOOST_TEST(lk.owns_lock() == false); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::shared_lock lk0(g_mutex, boost::defer_lock); + lk0.release(); + boost::upgrade_lock lk(boost::move(lk0), boost::try_to_lock); + BOOST_TEST(lk.mutex() == 0); + BOOST_TEST(lk.owns_lock() == false); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_until_pass.cpp index 796582a782..37c9ba36ea 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_until_pass.cpp @@ -28,34 +28,34 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { { - boost::shared_lock lk0(m); + boost::shared_lock lk0(g_mutex); boost::upgrade_lock lk( boost::move(lk0), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { boost::upgrade_lock - lk( boost::shared_lock(m), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + lk( boost::shared_lock(g_mutex), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); } { - boost::shared_lock lk0(m, boost::defer_lock); + boost::shared_lock lk0(g_mutex, boost::defer_lock); boost::upgrade_lock lk( boost::move(lk0), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); - BOOST_TEST(lk.mutex() == &m); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == false); BOOST_TEST(lk0.mutex() == 0); BOOST_TEST(lk0.owns_lock() == false); } { - boost::shared_lock lk0(m, boost::defer_lock); + boost::shared_lock lk0(g_mutex, boost::defer_lock); lk0.release(); boost::upgrade_lock lk( boost::move(lk0), boost::chrono::steady_clock::now()+boost::chrono::milliseconds(1)); BOOST_TEST(lk.mutex() == 0); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_unique_lock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_unique_lock_pass.cpp index 8917de647e..9df338d61e 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_unique_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_unique_lock_pass.cpp @@ -23,22 +23,22 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { { - boost::unique_lock lk0(m); - boost::upgrade_lock lk( (boost::move(lk0))); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); - BOOST_TEST(lk0.mutex() == 0); - BOOST_TEST(lk0.owns_lock() == false); + boost::unique_lock lk0(g_mutex); + boost::upgrade_lock lk( (boost::move(lk0))); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); + BOOST_TEST(lk0.mutex() == 0); + BOOST_TEST(lk0.owns_lock() == false); } { - boost::upgrade_lock lk( (boost::unique_lock(m))); - BOOST_TEST(lk.mutex() == &m); - BOOST_TEST(lk.owns_lock() == true); + boost::upgrade_lock lk( (boost::unique_lock(g_mutex))); + BOOST_TEST(lk.mutex() == &g_mutex); + BOOST_TEST(lk.owns_lock() == true); } return boost::report_errors(); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/mutex_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/mutex_pass.cpp index 67d318c4f4..52f969ebd9 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/mutex_pass.cpp @@ -26,7 +26,7 @@ #include #include "../../../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -34,8 +34,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -44,26 +44,26 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { - boost::upgrade_lock ul(m); - t1 = Clock::now(); + boost::upgrade_lock ul(g_mutex); + g_t1 = Clock::now(); } #else - //time_point t0 = Clock::now(); - //time_point t1; + //time_point g_t0 = Clock::now(); + //time_point g_t1; { - boost::upgrade_lock ul(m); - //t1 = Clock::now(); + boost::upgrade_lock ul(g_mutex); + //g_t1 = Clock::now(); } - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -71,12 +71,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/time_point_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/time_point_pass.cpp index ac55125229..bda497f8cf 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/time_point_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/time_point_pass.cpp @@ -27,59 +27,59 @@ #include #include "../../../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { - t0 = Clock::now(); - boost::upgrade_lock lk(m, Clock::now() + ms(750)); + g_t0 = Clock::now(); + boost::upgrade_lock lk(g_mutex, Clock::now() + ms(750)); BOOST_TEST(lk.owns_lock() == true); - t1 = Clock::now(); + g_t1 = Clock::now(); } void f2() { - t0 = Clock::now(); - boost::upgrade_lock lk(m, Clock::now() + ms(250)); + g_t0 = Clock::now(); + boost::upgrade_lock lk(g_mutex, Clock::now() + ms(250)); BOOST_TEST(lk.owns_lock() == false); - t1 = Clock::now(); - ns d = t1 - t0 - ms(250); + g_t1 = Clock::now(); + ns d = g_t1 - g_t0 - ms(250); BOOST_THREAD_TEST_IT(d, ns(max_diff)); } int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); BOOST_THREAD_TEST_IT(d_ns, ns(max_diff)); } { - m.lock(); + g_mutex.lock(); boost::thread t(f2); boost::this_thread::sleep_for(ms(750)); - m.unlock(); + g_mutex.unlock(); t.join(); } diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/try_to_lock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/try_to_lock_pass.cpp index 91be65dede..18e982597d 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/cons/try_to_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/cons/try_to_lock_pass.cpp @@ -25,7 +25,7 @@ #include #include "../../../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -33,8 +33,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -43,56 +43,56 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); + g_t0 = Clock::now(); { - boost::upgrade_lock lk(m, boost::try_to_lock); + boost::upgrade_lock lk(g_mutex, boost::try_to_lock); BOOST_TEST(lk.owns_lock() == false); } { - boost::upgrade_lock lk(m, boost::try_to_lock); + boost::upgrade_lock lk(g_mutex, boost::try_to_lock); BOOST_TEST(lk.owns_lock() == false); } { - boost::upgrade_lock lk(m, boost::try_to_lock); + boost::upgrade_lock lk(g_mutex, boost::try_to_lock); BOOST_TEST(lk.owns_lock() == false); } for (;;) { - boost::upgrade_lock lk(m, boost::try_to_lock); + boost::upgrade_lock lk(g_mutex, boost::try_to_lock); if (lk.owns_lock()) { - t1 = Clock::now(); + g_t1 = Clock::now(); break; } } - //m.unlock(); + //g_mutex.unlock(); #else -// time_point t0 = Clock::now(); +// time_point g_t0 = Clock::now(); // { -// boost::upgrade_lock lk(m, boost::try_to_lock); +// boost::upgrade_lock lk(g_mutex, boost::try_to_lock); // BOOST_TEST(lk.owns_lock() == false); // } // { -// boost::upgrade_lock lk(m, boost::try_to_lock); +// boost::upgrade_lock lk(g_mutex, boost::try_to_lock); // BOOST_TEST(lk.owns_lock() == false); // } // { -// boost::upgrade_lock lk(m, boost::try_to_lock); +// boost::upgrade_lock lk(g_mutex, boost::try_to_lock); // BOOST_TEST(lk.owns_lock() == false); // } for (;;) { - boost::upgrade_lock lk(m, boost::try_to_lock); + boost::upgrade_lock lk(g_mutex, boost::try_to_lock); if (lk.owns_lock()) break; } - //time_point t1 = Clock::now(); - //ns d = t1 - t0 - ms(250); + //time_point g_t1 = Clock::now(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -100,12 +100,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/lock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/lock_pass.cpp index 7ec16f839b..bda975398e 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/lock_pass.cpp @@ -25,7 +25,7 @@ #include #include "../../../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -33,8 +33,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -43,10 +43,10 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - boost::upgrade_lock < boost::shared_mutex > lk(m, boost::defer_lock); - t0 = Clock::now(); + boost::upgrade_lock < boost::shared_mutex > lk(g_mutex, boost::defer_lock); + g_t0 = Clock::now(); lk.lock(); - t1 = Clock::now(); + g_t1 = Clock::now(); BOOST_TEST(lk.owns_lock() == true); try { @@ -69,12 +69,12 @@ void f() BOOST_TEST(e.code().value() == boost::system::errc::operation_not_permitted); } #else - boost::upgrade_lock < boost::shared_mutex > lk(m, boost::defer_lock); - //time_point t0 = Clock::now(); + boost::upgrade_lock < boost::shared_mutex > lk(g_mutex, boost::defer_lock); + //time_point g_t0 = Clock::now(); lk.lock(); - //time_point t1 = Clock::now(); + //time_point g_t1 = Clock::now(); BOOST_TEST(lk.owns_lock() == true); - //ns d = t1 - t0 - ms(250); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); try { @@ -101,7 +101,7 @@ void f() int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -109,12 +109,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_for_pass.cpp index 6f4fd6426e..04d080651a 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_for_pass.cpp @@ -41,11 +41,11 @@ struct shared_mutex } }; -shared_mutex m; +shared_mutex g_mutex; int main() { - boost::upgrade_lock lk(m, boost::defer_lock); + boost::upgrade_lock lk(g_mutex, boost::defer_lock); BOOST_TEST(lk.try_lock_for(ms(5)) == true); BOOST_TEST(try_lock_for_called == true); BOOST_TEST(lk.owns_lock() == true); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_pass.cpp index 05721fc476..d2da94afac 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_pass.cpp @@ -37,11 +37,11 @@ struct shared_mutex } }; -shared_mutex m; +shared_mutex g_mutex; int main() { - boost::upgrade_lock lk(m, boost::defer_lock); + boost::upgrade_lock lk(g_mutex, boost::defer_lock); BOOST_TEST(lk.try_lock() == true); BOOST_TEST(try_lock_called == true); BOOST_TEST(lk.owns_lock() == true); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp index 1587074d9c..41748a314f 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp @@ -40,12 +40,12 @@ struct shared_mutex } }; -shared_mutex m; +shared_mutex g_mutex; int main() { typedef boost::chrono::steady_clock Clock; - boost::upgrade_lock lk(m, boost::defer_lock); + boost::upgrade_lock lk(g_mutex, boost::defer_lock); BOOST_TEST(lk.try_lock_until(Clock::now()) == true); BOOST_TEST(try_lock_until_called == true); BOOST_TEST(lk.owns_lock() == true); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/unlock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/unlock_pass.cpp index c9daae9a00..53fbd91b64 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/unlock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/unlock_pass.cpp @@ -36,11 +36,11 @@ struct shared_mutex } }; -shared_mutex m; +shared_mutex g_mutex; int main() { - boost::upgrade_lock lk(m); + boost::upgrade_lock lk(g_mutex); lk.unlock(); BOOST_TEST(unlock_called == true); BOOST_TEST(lk.owns_lock() == false); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/mod/member_swap_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/mod/member_swap_pass.cpp index 68b8eaa55b..fe1b825e3c 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/mod/member_swap_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/mod/member_swap_pass.cpp @@ -31,16 +31,16 @@ struct shared_mutex } }; -shared_mutex m; +shared_mutex g_mutex; int main() { - boost::upgrade_lock lk1(m); + boost::upgrade_lock lk1(g_mutex); boost::upgrade_lock lk2; lk1.swap(lk2); BOOST_TEST(lk1.mutex() == 0); BOOST_TEST(lk1.owns_lock() == false); - BOOST_TEST(lk2.mutex() == &m); + BOOST_TEST(lk2.mutex() == &g_mutex); BOOST_TEST(lk2.owns_lock() == true); return boost::report_errors(); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/mod/non_member_swap_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/mod/non_member_swap_pass.cpp index 7c64642f98..0ef2f766ba 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/mod/non_member_swap_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/mod/non_member_swap_pass.cpp @@ -30,16 +30,16 @@ struct shared_mutex } }; -shared_mutex m; +shared_mutex g_mutex; int main() { - boost::upgrade_lock lk1(m); + boost::upgrade_lock lk1(g_mutex); boost::upgrade_lock lk2; swap(lk1, lk2); BOOST_TEST(lk1.mutex() == 0); BOOST_TEST(lk1.owns_lock() == false); - BOOST_TEST(lk2.mutex() == &m); + BOOST_TEST(lk2.mutex() == &g_mutex); BOOST_TEST(lk2.owns_lock() == true); return boost::report_errors(); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/mod/release_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/mod/release_pass.cpp index ca01e36402..6985dd0206 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/mod/release_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/mod/release_pass.cpp @@ -38,16 +38,16 @@ struct shared_mutex int shared_mutex::lock_count = 0; int shared_mutex::unlock_count = 0; -shared_mutex m; +shared_mutex g_mutex; int main() { - boost::upgrade_lock lk(m); - BOOST_TEST(lk.mutex() == &m); + boost::upgrade_lock lk(g_mutex); + BOOST_TEST(lk.mutex() == &g_mutex); BOOST_TEST(lk.owns_lock() == true); BOOST_TEST(shared_mutex::lock_count == 1); BOOST_TEST(shared_mutex::unlock_count == 0); - BOOST_TEST(lk.release() == &m); + BOOST_TEST(lk.release() == &g_mutex); BOOST_TEST(lk.mutex() == 0); BOOST_TEST(lk.owns_lock() == false); BOOST_TEST(shared_mutex::lock_count == 1); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/obs/mutex_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/obs/mutex_pass.cpp index a923087267..e05e3b3795 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/obs/mutex_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/obs/mutex_pass.cpp @@ -22,16 +22,16 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { boost::upgrade_lock lk0; BOOST_TEST(lk0.mutex() == 0); - boost::upgrade_lock lk1(m); - BOOST_TEST(lk1.mutex() == &m); + boost::upgrade_lock lk1(g_mutex); + BOOST_TEST(lk1.mutex() == &g_mutex); lk1.unlock(); - BOOST_TEST(lk1.mutex() == &m); + BOOST_TEST(lk1.mutex() == &g_mutex); return boost::report_errors(); } diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/obs/op_bool_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/obs/op_bool_pass.cpp index ae891de4a5..8291547309 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/obs/op_bool_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/obs/op_bool_pass.cpp @@ -22,13 +22,13 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { boost::upgrade_lock < boost::shared_mutex > lk0; BOOST_TEST(bool(lk0) == false); - boost::upgrade_lock < boost::shared_mutex > lk1(m); + boost::upgrade_lock < boost::shared_mutex > lk1(g_mutex); BOOST_TEST(bool(lk1) == true); lk1.unlock(); BOOST_TEST(bool(lk1) == false); diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/obs/owns_lock_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/obs/owns_lock_pass.cpp index 72b904c23f..81a148e67a 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/obs/owns_lock_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/obs/owns_lock_pass.cpp @@ -22,13 +22,13 @@ #include #include -boost::shared_mutex m; +boost::shared_mutex g_mutex; int main() { boost::upgrade_lock lk0; BOOST_TEST(lk0.owns_lock() == false); - boost::upgrade_lock lk1(m); + boost::upgrade_lock lk1(g_mutex); BOOST_TEST(lk1.owns_lock() == true); lk1.unlock(); BOOST_TEST(lk1.owns_lock() == false); diff --git a/test/sync/mutual_exclusion/mutex/lock_pass.cpp b/test/sync/mutual_exclusion/mutex/lock_pass.cpp index 13b94834f7..0b3fc8f1be 100644 --- a/test/sync/mutual_exclusion/mutex/lock_pass.cpp +++ b/test/sync/mutual_exclusion/mutex/lock_pass.cpp @@ -23,7 +23,7 @@ #include #include "../../../timming.hpp" -boost::mutex m; +boost::mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -31,8 +31,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -41,35 +41,35 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); - m.lock(); - t1 = Clock::now(); - m.unlock(); + g_t0 = Clock::now(); + g_mutex.lock(); + g_t1 = Clock::now(); + g_mutex.unlock(); #else - //time_point t0 = Clock::now(); - m.lock(); - //time_point t1 = Clock::now(); - m.unlock(); - //ns d = t1 - t0 - ms(250); + //time_point g_t0 = Clock::now(); + g_mutex.lock(); + //time_point g_t1 = Clock::now(); + g_mutex.unlock(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/mutex/try_lock_pass.cpp b/test/sync/mutual_exclusion/mutex/try_lock_pass.cpp index 1c503d2be7..1372ea26fe 100644 --- a/test/sync/mutual_exclusion/mutex/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/mutex/try_lock_pass.cpp @@ -24,7 +24,7 @@ #include "../../../timming.hpp" -boost::mutex m; +boost::mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -32,8 +32,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #endif const ms max_diff(BOOST_THREAD_TEST_TIME_MS); @@ -41,44 +41,43 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); - BOOST_TEST(!m.try_lock()); - BOOST_TEST(!m.try_lock()); - BOOST_TEST(!m.try_lock()); - while (!m.try_lock()) + g_t0 = Clock::now(); + BOOST_TEST(!g_mutex.try_lock()); + BOOST_TEST(!g_mutex.try_lock()); + BOOST_TEST(!g_mutex.try_lock()); + while (!g_mutex.try_lock()) ; - t1 = Clock::now(); - m.unlock(); + g_t1 = Clock::now(); + g_mutex.unlock(); #else - //time_point t0 = Clock::now(); - //BOOST_TEST(!m.try_lock()); - //BOOST_TEST(!m.try_lock()); - //BOOST_TEST(!m.try_lock()); - while (!m.try_lock()) + //time_point g_t0 = Clock::now(); + //BOOST_TEST(!g_mutex.try_lock()); + //BOOST_TEST(!g_mutex.try_lock()); + //BOOST_TEST(!g_mutex.try_lock()); + while (!g_mutex.try_lock()) ; - //time_point t1 = Clock::now(); - m.unlock(); - //ns d = t1 - t0 - ms(250); + //time_point g_t1 = Clock::now(); + g_mutex.unlock(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif - } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); @@ -87,5 +86,3 @@ int main() return boost::report_errors(); } - - diff --git a/test/sync/mutual_exclusion/null_mutex/lock_pass.cpp b/test/sync/mutual_exclusion/null_mutex/lock_pass.cpp index 793878114c..4efba18e94 100644 --- a/test/sync/mutual_exclusion/null_mutex/lock_pass.cpp +++ b/test/sync/mutual_exclusion/null_mutex/lock_pass.cpp @@ -23,7 +23,7 @@ #include #include "../../../timming.hpp" -boost::null_mutex m; +boost::null_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -40,20 +40,20 @@ void f() { #if defined BOOST_THREAD_USES_CHRONO time_point t0 = Clock::now(); - m.lock(); + g_mutex.lock(); time_point t1 = Clock::now(); - m.lock(); - m.unlock(); - m.unlock(); + g_mutex.lock(); + g_mutex.unlock(); + g_mutex.unlock(); ns d = t1 - t0 ; BOOST_THREAD_TEST_IT(d, ns(max_diff)); #else //time_point t0 = Clock::now(); - m.lock(); + g_mutex.lock(); //time_point t1 = Clock::now(); - m.lock(); - m.unlock(); - m.unlock(); + g_mutex.lock(); + g_mutex.unlock(); + g_mutex.unlock(); //ns d = t1 - t0 ; //BOOST_TEST(d < max_diff); #endif @@ -61,9 +61,9 @@ void f() int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); - m.unlock(); + g_mutex.unlock(); t.join(); return boost::report_errors(); diff --git a/test/sync/mutual_exclusion/null_mutex/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/null_mutex/try_lock_for_pass.cpp index 891b06e308..a4fdbaeda5 100644 --- a/test/sync/mutual_exclusion/null_mutex/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/null_mutex/try_lock_for_pass.cpp @@ -27,7 +27,7 @@ #if defined BOOST_THREAD_USES_CHRONO -boost::null_mutex m; +boost::null_mutex g_mutex; typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; @@ -40,11 +40,11 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { time_point t0 = Clock::now(); - BOOST_TEST(m.try_lock_for(ms(250)) == true); + BOOST_TEST(g_mutex.try_lock_for(ms(250)) == true); time_point t1 = Clock::now(); - BOOST_TEST(m.try_lock()); - m.unlock(); - m.unlock(); + BOOST_TEST(g_mutex.try_lock()); + g_mutex.unlock(); + g_mutex.unlock(); ns d = t1 - t0 ; BOOST_THREAD_TEST_IT(d, ns(max_diff)); } @@ -52,9 +52,9 @@ void f1() int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); - m.unlock(); + g_mutex.unlock(); t.join(); } diff --git a/test/sync/mutual_exclusion/null_mutex/try_lock_pass.cpp b/test/sync/mutual_exclusion/null_mutex/try_lock_pass.cpp index 1bdd71faff..0780f54d83 100644 --- a/test/sync/mutual_exclusion/null_mutex/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/null_mutex/try_lock_pass.cpp @@ -25,7 +25,7 @@ -boost::null_mutex m; +boost::null_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -42,26 +42,26 @@ void f() { #if defined BOOST_THREAD_USES_CHRONO time_point t0 = Clock::now(); - BOOST_TEST(m.try_lock()); + BOOST_TEST(g_mutex.try_lock()); time_point t1 = Clock::now(); - BOOST_TEST(m.try_lock()); - m.unlock(); - m.unlock(); + BOOST_TEST(g_mutex.try_lock()); + g_mutex.unlock(); + g_mutex.unlock(); ns d = t1 - t0; BOOST_THREAD_TEST_IT(d, ns(max_diff)); #else - BOOST_TEST(m.try_lock()); - BOOST_TEST(m.try_lock()); - m.unlock(); - m.unlock(); + BOOST_TEST(g_mutex.try_lock()); + BOOST_TEST(g_mutex.try_lock()); + g_mutex.unlock(); + g_mutex.unlock(); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); - m.unlock(); + g_mutex.unlock(); t.join(); return boost::report_errors(); diff --git a/test/sync/mutual_exclusion/null_mutex/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/null_mutex/try_lock_until_pass.cpp index d03cb9ddbf..fbdf065b2a 100644 --- a/test/sync/mutual_exclusion/null_mutex/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/null_mutex/try_lock_until_pass.cpp @@ -26,7 +26,7 @@ #if defined BOOST_THREAD_USES_CHRONO -boost::null_mutex m; +boost::null_mutex g_mutex; typedef boost::chrono::steady_clock Clock; typedef Clock::time_point time_point; @@ -39,9 +39,9 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { time_point t0 = Clock::now(); - BOOST_TEST(m.try_lock_until(Clock::now() + ms(250)) == true); + BOOST_TEST(g_mutex.try_lock_until(Clock::now() + ms(250)) == true); time_point t1 = Clock::now(); - m.unlock(); + g_mutex.unlock(); ns d = t1 - t0 ; BOOST_THREAD_TEST_IT(d, ns(max_diff)); } @@ -50,9 +50,9 @@ void f1() int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); - m.unlock(); + g_mutex.unlock(); t.join(); } diff --git a/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp b/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp index 74a8dd8422..e3bbd68273 100644 --- a/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp +++ b/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp @@ -28,4 +28,3 @@ int main() } #include "../../../remove_error_code_unused_warning.hpp" - diff --git a/test/sync/mutual_exclusion/recursive_mutex/lock_pass.cpp b/test/sync/mutual_exclusion/recursive_mutex/lock_pass.cpp index f52d9fd2b3..21a5b31549 100644 --- a/test/sync/mutual_exclusion/recursive_mutex/lock_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_mutex/lock_pass.cpp @@ -24,7 +24,7 @@ #include "../../../timming.hpp" -boost::recursive_mutex m; +boost::recursive_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -32,8 +32,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -42,27 +42,27 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); - m.lock(); - t1 = Clock::now(); - m.lock(); - m.unlock(); - m.unlock(); + g_t0 = Clock::now(); + g_mutex.lock(); + g_t1 = Clock::now(); + g_mutex.lock(); + g_mutex.unlock(); + g_mutex.unlock(); #else - //time_point t0 = Clock::now(); - m.lock(); - //time_point t1 = Clock::now(); - m.lock(); - m.unlock(); - m.unlock(); - //ns d = t1 - t0 - ms(250); + //time_point g_t0 = Clock::now(); + g_mutex.lock(); + //time_point g_t1 = Clock::now(); + g_mutex.lock(); + g_mutex.unlock(); + g_mutex.unlock(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -70,12 +70,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/recursive_mutex/try_lock_pass.cpp b/test/sync/mutual_exclusion/recursive_mutex/try_lock_pass.cpp index a88e26249d..869556aece 100644 --- a/test/sync/mutual_exclusion/recursive_mutex/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_mutex/try_lock_pass.cpp @@ -24,7 +24,7 @@ #include #include "../../../timming.hpp" -boost::recursive_mutex m; +boost::recursive_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -32,8 +32,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -42,35 +42,35 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); -// BOOST_TEST(!m.try_lock()); -// BOOST_TEST(!m.try_lock()); -// BOOST_TEST(!m.try_lock()); - while (!m.try_lock()) + g_t0 = Clock::now(); +// BOOST_TEST(!g_mutex.try_lock()); +// BOOST_TEST(!g_mutex.try_lock()); +// BOOST_TEST(!g_mutex.try_lock()); + while (!g_mutex.try_lock()) ; - t1 = Clock::now(); - BOOST_TEST(m.try_lock()); - m.unlock(); - m.unlock(); + g_t1 = Clock::now(); + BOOST_TEST(g_mutex.try_lock()); + g_mutex.unlock(); + g_mutex.unlock(); #else - //time_point t0 = Clock::now(); - //BOOST_TEST(!m.try_lock()); - //BOOST_TEST(!m.try_lock()); - //BOOST_TEST(!m.try_lock()); - while (!m.try_lock()) + //time_point g_t0 = Clock::now(); + //BOOST_TEST(!g_mutex.try_lock()); + //BOOST_TEST(!g_mutex.try_lock()); + //BOOST_TEST(!g_mutex.try_lock()); + while (!g_mutex.try_lock()) ; - //time_point t1 = Clock::now(); - BOOST_TEST(m.try_lock()); - m.unlock(); - m.unlock(); - //ns d = t1 - t0 - ms(250); + //time_point g_t1 = Clock::now(); + BOOST_TEST(g_mutex.try_lock()); + g_mutex.unlock(); + g_mutex.unlock(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -78,12 +78,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/lock_pass.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/lock_pass.cpp index 4762db2c76..1e26a1870e 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/lock_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/lock_pass.cpp @@ -24,7 +24,7 @@ #include #include "../../../timming.hpp" -boost::recursive_timed_mutex m; +boost::recursive_timed_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -32,8 +32,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -42,27 +42,27 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); - m.lock(); - t1 = Clock::now(); - m.lock(); - m.unlock(); - m.unlock(); + g_t0 = Clock::now(); + g_mutex.lock(); + g_t1 = Clock::now(); + g_mutex.lock(); + g_mutex.unlock(); + g_mutex.unlock(); #else - //time_point t0 = Clock::now(); - m.lock(); - //time_point t1 = Clock::now(); - m.lock(); - m.unlock(); - m.unlock(); - //ns d = t1 - t0 - ms(250); + //time_point g_t0 = Clock::now(); + g_mutex.lock(); + //time_point g_t1 = Clock::now(); + g_mutex.lock(); + g_mutex.unlock(); + g_mutex.unlock(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -70,12 +70,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp index 3b8c1a962d..73b6aa4c0b 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp @@ -26,60 +26,60 @@ #if defined BOOST_THREAD_USES_CHRONO -boost::recursive_timed_mutex m; +boost::recursive_timed_mutex g_mutex; typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { - t0 = Clock::now(); - BOOST_TEST(m.try_lock_for(ms(750)) == true); - t1 = Clock::now(); - BOOST_TEST(m.try_lock()); - m.unlock(); - m.unlock(); + g_t0 = Clock::now(); + BOOST_TEST(g_mutex.try_lock_for(ms(750)) == true); + g_t1 = Clock::now(); + BOOST_TEST(g_mutex.try_lock()); + g_mutex.unlock(); + g_mutex.unlock(); } void f2() { - time_point t0 = Clock::now(); - BOOST_TEST(m.try_lock_for(ms(250)) == false); - time_point t1 = Clock::now(); - ns d = t1 - t0 - ms(250); + time_point g_t0 = Clock::now(); + BOOST_TEST(g_mutex.try_lock_for(ms(250)) == false); + time_point g_t1 = Clock::now(); + ns d = g_t1 - g_t0 - ms(250); BOOST_THREAD_TEST_IT(d, ns(max_diff)); } int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); BOOST_THREAD_TEST_IT(d_ns, ns(max_diff)); } { - m.lock(); + g_mutex.lock(); boost::thread t(f2); boost::this_thread::sleep_for(ms(750)); - m.unlock(); + g_mutex.unlock(); t.join(); } diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_pass.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_pass.cpp index 7a92af4e8b..9d9d8527b4 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_pass.cpp @@ -23,7 +23,7 @@ #include #include "../../../timming.hpp" -boost::recursive_timed_mutex m; +boost::recursive_timed_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -31,8 +31,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -41,35 +41,35 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); - BOOST_TEST(!m.try_lock()); - BOOST_TEST(!m.try_lock()); - BOOST_TEST(!m.try_lock()); - while (!m.try_lock()) + g_t0 = Clock::now(); + BOOST_TEST(!g_mutex.try_lock()); + BOOST_TEST(!g_mutex.try_lock()); + BOOST_TEST(!g_mutex.try_lock()); + while (!g_mutex.try_lock()) ; - t1 = Clock::now(); - BOOST_TEST(m.try_lock()); - m.unlock(); - m.unlock(); + g_t1 = Clock::now(); + BOOST_TEST(g_mutex.try_lock()); + g_mutex.unlock(); + g_mutex.unlock(); #else - //time_point t0 = Clock::now(); - //BOOST_TEST(!m.try_lock()); - //BOOST_TEST(!m.try_lock()); - //BOOST_TEST(!m.try_lock()); - while (!m.try_lock()) + //time_point g_t0 = Clock::now(); + //BOOST_TEST(!g_mutex.try_lock()); + //BOOST_TEST(!g_mutex.try_lock()); + //BOOST_TEST(!g_mutex.try_lock()); + while (!g_mutex.try_lock()) ; - //time_point t1 = Clock::now(); - BOOST_TEST(m.try_lock()); - m.unlock(); - m.unlock(); - //ns d = t1 - t0 - ms(250); + //time_point g_t1 = Clock::now(); + BOOST_TEST(g_mutex.try_lock()); + g_mutex.unlock(); + g_mutex.unlock(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -77,12 +77,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_until_pass.cpp index f028ea96f7..c9bb2149b4 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_until_pass.cpp @@ -26,49 +26,49 @@ #if defined BOOST_THREAD_USES_CHRONO -boost::recursive_timed_mutex m; +boost::recursive_timed_mutex g_mutex; typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { - t0 = Clock::now(); - BOOST_TEST(m.try_lock_until(Clock::now() + ms(750)) == true); - t1 = Clock::now(); - m.unlock(); + g_t0 = Clock::now(); + BOOST_TEST(g_mutex.try_lock_until(Clock::now() + ms(750)) == true); + g_t1 = Clock::now(); + g_mutex.unlock(); } void f2() { - t0 = Clock::now(); - BOOST_TEST(m.try_lock_until(Clock::now() + ms(250)) == false); - t1 = Clock::now(); - ns d = t1 - t0 - ms(250); + g_t0 = Clock::now(); + BOOST_TEST(g_mutex.try_lock_until(Clock::now() + ms(250)) == false); + g_t1 = Clock::now(); + ns d = g_t1 - g_t0 - ms(250); BOOST_THREAD_TEST_IT(d, ns(max_diff)); } int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); @@ -76,10 +76,10 @@ int main() #endif } { - m.lock(); + g_mutex.lock(); boost::thread t(f2); boost::this_thread::sleep_for(ms(750)); - m.unlock(); + g_mutex.unlock(); t.join(); } diff --git a/test/sync/mutual_exclusion/shared_mutex/lock_pass.cpp b/test/sync/mutual_exclusion/shared_mutex/lock_pass.cpp index d8d1b8cb3c..c6e20a1106 100644 --- a/test/sync/mutual_exclusion/shared_mutex/lock_pass.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/lock_pass.cpp @@ -23,7 +23,7 @@ #include #include "../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -31,8 +31,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -41,23 +41,23 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); - m.lock(); - t1 = Clock::now(); - m.unlock(); + g_t0 = Clock::now(); + g_mutex.lock(); + g_t1 = Clock::now(); + g_mutex.unlock(); #else - //time_point t0 = Clock::now(); - m.lock(); - //time_point t1 = Clock::now(); - m.unlock(); - //ns d = t1 - t0 - ms(250); + //time_point g_t0 = Clock::now(); + g_mutex.lock(); + //time_point g_t1 = Clock::now(); + g_mutex.unlock(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -65,12 +65,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); @@ -79,4 +79,3 @@ int main() return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/shared_mutex/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/shared_mutex/try_lock_for_pass.cpp index 207456def0..60f4e8c762 100644 --- a/test/sync/mutual_exclusion/shared_mutex/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/try_lock_for_pass.cpp @@ -24,49 +24,49 @@ #include #include "../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { - t0 = Clock::now(); - BOOST_TEST(m.try_lock_for(ms(750)) == true); - t1 = Clock::now(); - m.unlock(); + g_t0 = Clock::now(); + BOOST_TEST(g_mutex.try_lock_for(ms(750)) == true); + g_t1 = Clock::now(); + g_mutex.unlock(); } void f2() { - t0 = Clock::now(); - BOOST_TEST(m.try_lock_for(ms(250)) == false); - t1 = Clock::now(); - ns d = t1 - t0 - ms(250); + g_t0 = Clock::now(); + BOOST_TEST(g_mutex.try_lock_for(ms(250)) == false); + g_t1 = Clock::now(); + ns d = g_t1 - g_t0 - ms(250); BOOST_THREAD_TEST_IT(d, ns(max_diff)); } int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); @@ -74,10 +74,10 @@ int main() #endif } { - m.lock(); + g_mutex.lock(); boost::thread t(f2); boost::this_thread::sleep_for(ms(750)); - m.unlock(); + g_mutex.unlock(); t.join(); } diff --git a/test/sync/mutual_exclusion/shared_mutex/try_lock_pass.cpp b/test/sync/mutual_exclusion/shared_mutex/try_lock_pass.cpp index b52995cafd..6d9ecac3de 100644 --- a/test/sync/mutual_exclusion/shared_mutex/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/try_lock_pass.cpp @@ -23,7 +23,7 @@ #include #include "../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -31,8 +31,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -41,31 +41,31 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); - BOOST_TEST(!m.try_lock()); - BOOST_TEST(!m.try_lock()); - BOOST_TEST(!m.try_lock()); - while (!m.try_lock()) + g_t0 = Clock::now(); + BOOST_TEST(!g_mutex.try_lock()); + BOOST_TEST(!g_mutex.try_lock()); + BOOST_TEST(!g_mutex.try_lock()); + while (!g_mutex.try_lock()) ; - t1 = Clock::now(); - m.unlock(); + g_t1 = Clock::now(); + g_mutex.unlock(); #else - //time_point t0 = Clock::now(); - //BOOST_TEST(!m.try_lock()); - //BOOST_TEST(!m.try_lock()); - //BOOST_TEST(!m.try_lock()); - while (!m.try_lock()) + //time_point g_t0 = Clock::now(); + //BOOST_TEST(!g_mutex.try_lock()); + //BOOST_TEST(!g_mutex.try_lock()); + //BOOST_TEST(!g_mutex.try_lock()); + while (!g_mutex.try_lock()) ; - //time_point t1 = Clock::now(); - m.unlock(); - //ns d = t1 - t0 - ms(250); + //time_point g_t1 = Clock::now(); + g_mutex.unlock(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -73,12 +73,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); @@ -87,4 +87,3 @@ int main() return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/shared_mutex/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/shared_mutex/try_lock_until_pass.cpp index 42ac0e46a1..8625be786b 100644 --- a/test/sync/mutual_exclusion/shared_mutex/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/try_lock_until_pass.cpp @@ -24,58 +24,58 @@ #include #include "../../../timming.hpp" -boost::shared_mutex m; +boost::shared_mutex g_mutex; typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { - t0 = Clock::now(); - BOOST_TEST(m.try_lock_until(Clock::now() + ms(750)) == true); - t1 = Clock::now(); - m.unlock(); + g_t0 = Clock::now(); + BOOST_TEST(g_mutex.try_lock_until(Clock::now() + ms(750)) == true); + g_t1 = Clock::now(); + g_mutex.unlock(); } void f2() { - t0 = Clock::now(); - BOOST_TEST(m.try_lock_until(Clock::now() + ms(250)) == false); - t1 = Clock::now(); - ns d = t1 - t0 - ms(250); + g_t0 = Clock::now(); + BOOST_TEST(g_mutex.try_lock_until(Clock::now() + ms(250)) == false); + g_t1 = Clock::now(); + ns d = g_t1 - g_t0 - ms(250); BOOST_THREAD_TEST_IT(d, ns(max_diff)); } int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); BOOST_THREAD_TEST_IT(d_ns, ns(max_diff)); } { - m.lock(); + g_mutex.lock(); boost::thread t(f2); boost::this_thread::sleep_for(ms(750)); - m.unlock(); + g_mutex.unlock(); t.join(); } diff --git a/test/sync/mutual_exclusion/timed_mutex/lock_pass.cpp b/test/sync/mutual_exclusion/timed_mutex/lock_pass.cpp index 50079a8157..b66c7717b7 100644 --- a/test/sync/mutual_exclusion/timed_mutex/lock_pass.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/lock_pass.cpp @@ -23,7 +23,7 @@ #include #include "../../../timming.hpp" -boost::timed_mutex m; +boost::timed_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -31,8 +31,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -41,23 +41,23 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); - m.lock(); - t1 = Clock::now(); - m.unlock(); + g_t0 = Clock::now(); + g_mutex.lock(); + g_t1 = Clock::now(); + g_mutex.unlock(); #else - //time_point t0 = Clock::now(); - m.lock(); - //time_point t1 = Clock::now(); - m.unlock(); - //ns d = t1 - t0 - ms(250); + //time_point g_t0 = Clock::now(); + g_mutex.lock(); + //time_point g_t1 = Clock::now(); + g_mutex.unlock(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -65,12 +65,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/timed_mutex/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/timed_mutex/try_lock_for_pass.cpp index 04774a3c8b..1b8a334ef9 100644 --- a/test/sync/mutual_exclusion/timed_mutex/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/try_lock_for_pass.cpp @@ -26,58 +26,58 @@ #if defined BOOST_THREAD_USES_CHRONO -boost::timed_mutex m; +boost::timed_mutex g_mutex; typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { - t0 = Clock::now(); - BOOST_TEST(m.try_lock_for(ms(750)) == true); - t1 = Clock::now(); - m.unlock(); + g_t0 = Clock::now(); + BOOST_TEST(g_mutex.try_lock_for(ms(750)) == true); + g_t1 = Clock::now(); + g_mutex.unlock(); } void f2() { - t0 = Clock::now(); - BOOST_TEST(m.try_lock_for(ms(250)) == false); - t1 = Clock::now(); - ns d = t1 - t0 - ms(250); + g_t0 = Clock::now(); + BOOST_TEST(g_mutex.try_lock_for(ms(250)) == false); + g_t1 = Clock::now(); + ns d = g_t1 - g_t0 - ms(250); BOOST_THREAD_TEST_IT(d, ns(max_diff)); } int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); BOOST_THREAD_TEST_IT(d_ns, ns(max_diff)); } { - m.lock(); + g_mutex.lock(); boost::thread t(f2); boost::this_thread::sleep_for(ms(750)); - m.unlock(); + g_mutex.unlock(); t.join(); } diff --git a/test/sync/mutual_exclusion/timed_mutex/try_lock_pass.cpp b/test/sync/mutual_exclusion/timed_mutex/try_lock_pass.cpp index 3f87564b46..1f7d73b3f5 100644 --- a/test/sync/mutual_exclusion/timed_mutex/try_lock_pass.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/try_lock_pass.cpp @@ -24,7 +24,7 @@ #include "../../../timming.hpp" -boost::timed_mutex m; +boost::timed_mutex g_mutex; #if defined BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; @@ -32,8 +32,8 @@ typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; #else #endif @@ -42,31 +42,31 @@ const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f() { #if defined BOOST_THREAD_USES_CHRONO - t0 = Clock::now(); - BOOST_TEST(!m.try_lock()); - BOOST_TEST(!m.try_lock()); - BOOST_TEST(!m.try_lock()); - while (!m.try_lock()) + g_t0 = Clock::now(); + BOOST_TEST(!g_mutex.try_lock()); + BOOST_TEST(!g_mutex.try_lock()); + BOOST_TEST(!g_mutex.try_lock()); + while (!g_mutex.try_lock()) ; - t1 = Clock::now(); - m.unlock(); + g_t1 = Clock::now(); + g_mutex.unlock(); #else - //time_point t0 = Clock::now(); - //BOOST_TEST(!m.try_lock()); - //BOOST_TEST(!m.try_lock()); - //BOOST_TEST(!m.try_lock()); - while (!m.try_lock()) + //time_point g_t0 = Clock::now(); + //BOOST_TEST(!g_mutex.try_lock()); + //BOOST_TEST(!g_mutex.try_lock()); + //BOOST_TEST(!g_mutex.try_lock()); + while (!g_mutex.try_lock()) ; - //time_point t1 = Clock::now(); - m.unlock(); - //ns d = t1 - t0 - ms(250); + //time_point g_t1 = Clock::now(); + g_mutex.unlock(); + //ns d = g_t1 - g_t0 - ms(250); //BOOST_TEST(d < max_diff); #endif } int main() { - m.lock(); + g_mutex.lock(); boost::thread t(f); #if defined BOOST_THREAD_USES_CHRONO time_point t2 = Clock::now(); @@ -74,12 +74,12 @@ int main() time_point t3 = Clock::now(); #else #endif - m.unlock(); + g_mutex.unlock(); t.join(); #if defined BOOST_THREAD_USES_CHRONO ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); diff --git a/test/sync/mutual_exclusion/timed_mutex/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/timed_mutex/try_lock_until_pass.cpp index b4f8490586..e5d9425e43 100644 --- a/test/sync/mutual_exclusion/timed_mutex/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/try_lock_until_pass.cpp @@ -26,58 +26,58 @@ #if defined BOOST_THREAD_USES_CHRONO -boost::timed_mutex m; +boost::timed_mutex g_mutex; typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; -time_point t0; -time_point t1; +time_point g_t0; +time_point g_t1; const ms max_diff(BOOST_THREAD_TEST_TIME_MS); void f1() { - t0 = Clock::now(); - BOOST_TEST(m.try_lock_until(Clock::now() + ms(750)) == true); - t1 = Clock::now(); - m.unlock(); + g_t0 = Clock::now(); + BOOST_TEST(g_mutex.try_lock_until(Clock::now() + ms(750)) == true); + g_t1 = Clock::now(); + g_mutex.unlock(); } void f2() { - t0 = Clock::now(); - BOOST_TEST(m.try_lock_until(Clock::now() + ms(250)) == false); - t1 = Clock::now(); - ns d = t1 - t0 - ms(250); + g_t0 = Clock::now(); + BOOST_TEST(g_mutex.try_lock_until(Clock::now() + ms(250)) == false); + g_t1 = Clock::now(); + ns d = g_t1 - g_t0 - ms(250); BOOST_THREAD_TEST_IT(d, ns(max_diff)); } int main() { { - m.lock(); + g_mutex.lock(); boost::thread t(f1); time_point t2 = Clock::now(); boost::this_thread::sleep_for(ms(250)); time_point t3 = Clock::now(); - m.unlock(); + g_mutex.unlock(); t.join(); ns sleep_time = t3 - t2; - ns d_ns = t1 - t0 - sleep_time; + ns d_ns = g_t1 - g_t0 - sleep_time; ms d_ms = boost::chrono::duration_cast(d_ns); // BOOST_TEST_GE(d_ms.count(), 0); BOOST_THREAD_TEST_IT(d_ms, max_diff); BOOST_THREAD_TEST_IT(d_ns, ns(max_diff)); } { - m.lock(); + g_mutex.lock(); boost::thread t(f2); boost::this_thread::sleep_for(ms(750)); - m.unlock(); + g_mutex.unlock(); t.join(); } diff --git a/test/test_once.cpp b/test/test_once.cpp index 3103f1c237..8d716fd03f 100644 --- a/test/test_once.cpp +++ b/test/test_once.cpp @@ -15,15 +15,15 @@ #include -boost::once_flag flag=BOOST_ONCE_INIT; -int var_to_init=0; -boost::mutex m; +boost::once_flag g_flag=BOOST_ONCE_INIT; +int g_var_to_init=0; +boost::mutex g_mutex; void initialize_variable() { // ensure that if multiple threads get in here, they are serialized, so we can see the effect - boost::unique_lock lock(m); - ++var_to_init; + boost::unique_lock lock(g_mutex); + ++g_var_to_init; } @@ -33,14 +33,14 @@ void call_once_thread() int my_once_value=0; for(unsigned i=0;i lock(m); + boost::unique_lock lock(g_mutex); BOOST_CHECK_EQUAL(my_once_value, 1); } @@ -66,7 +66,7 @@ BOOST_AUTO_TEST_CASE(test_call_once) throw; } - BOOST_CHECK_EQUAL(var_to_init,1); + BOOST_CHECK_EQUAL(g_var_to_init,1); } int var_to_init_with_functor=0; @@ -80,7 +80,7 @@ struct increment_value void operator()() const { - boost::unique_lock lock(m); + boost::unique_lock lock(g_mutex); ++(*value); } }; @@ -99,7 +99,7 @@ void call_once_with_functor() break; } } - boost::unique_lock lock(m); + boost::unique_lock lock(g_mutex); BOOST_CHECK_EQUAL(my_once_value, 1); } @@ -138,7 +138,7 @@ struct throw_before_third_pass void operator()() const { - boost::unique_lock lock(m); + boost::unique_lock lock(g_mutex); ++pass_counter; if(pass_counter<3) { @@ -159,14 +159,14 @@ void call_once_with_exception() } catch(throw_before_third_pass::my_exception) { - boost::unique_lock lock(m); + boost::unique_lock lock(g_mutex); ++exception_counter; } } BOOST_AUTO_TEST_CASE(test_call_once_retried_on_exception) { - BOOST_DETAIL_THREAD_LOG; + BOOST_DETAIL_THREAD_LOG; unsigned const num_threads=20; boost::thread_group group; @@ -188,5 +188,3 @@ BOOST_AUTO_TEST_CASE(test_call_once_retried_on_exception) BOOST_CHECK_EQUAL(throw_before_third_pass::pass_counter,3u); BOOST_CHECK_EQUAL(exception_counter,2u); } - - diff --git a/test/threads/container/thread_vector_pass.cpp b/test/threads/container/thread_vector_pass.cpp index 6c45317d61..23a5729509 100644 --- a/test/threads/container/thread_vector_pass.cpp +++ b/test/threads/container/thread_vector_pass.cpp @@ -12,8 +12,8 @@ #include #include -int count = 0; -boost::mutex mutex; +int g_count = 0; +boost::mutex g_mutex; namespace { @@ -40,8 +40,8 @@ void interrupt_all(TC & tc) void increment_count() { - boost::unique_lock lock(mutex); - std::cout << "count = " << ++count << std::endl; + boost::unique_lock lock(g_mutex); + std::cout << "count = " << ++g_count << std::endl; } #if defined BOOST_NO_CXX11_RVALUE_REFERENCES && defined BOOST_THREAD_USES_MOVE @@ -61,7 +61,7 @@ int main() } join_all(threads); } - count = 0; + g_count = 0; { thread_vector threads; threads.reserve(10); @@ -71,7 +71,7 @@ int main() } join_all(threads); } - count = 0; + g_count = 0; { thread_vector threads; threads.reserve(10); @@ -81,7 +81,7 @@ int main() } join_all(threads); } - count = 0; + g_count = 0; { thread_vector threads; threads.reserve(10); From dd60839a4ea2392264d47e32ccd58c8e1e9a3a51 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 1 Jul 2026 10:41:21 +0300 Subject: [PATCH 56/80] Added multiple attemps of timed waits on a cv in mutex lock tests. Condition variable timed waits may occasionally return true even if noone notifies on the variable, which breaks the tests that expect a timeout. This is considered as spurious wakeups. Add a few attempts at waiting, which should significantly reduce the likelyhood of test failures. --- test/test_mutex.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/test/test_mutex.cpp b/test/test_mutex.cpp index d581a053de..7927e03297 100644 --- a/test/test_mutex.cpp +++ b/test/test_mutex.cpp @@ -25,6 +25,8 @@ #define DEFAULT_EXECUTION_MONITOR_TYPE execution_monitor::use_sleep_only #include "./util.inl" +const unsigned int max_wait_attempts = 10u; + template struct test_lock { @@ -48,9 +50,12 @@ struct test_lock boost::xtime xt = delay(0, 100); // Test the lock and the mutex with condition variables. - // No one is going to notify this condition variable. We expect to - // time out. - BOOST_CHECK(!condition.timed_wait(lock, xt)); + // No one is going to notify this condition variable. We expect it to + // usually time out. It may occasionally return true due to a spurious wakeup. + bool wait_result = true; + for (unsigned int attempt = 0u; wait_result && attempt < max_wait_attempts; ++attempt) + wait_result = condition.timed_wait(lock, xt); + BOOST_CHECK(!wait_result); BOOST_CHECK(lock ? true : false); // Test the lock and unlock methods. @@ -88,9 +93,12 @@ struct test_trylock boost::xtime xt = delay(0, 100); // Test the lock and the mutex with condition variables. - // No one is going to notify this condition variable. We expect to - // time out. - BOOST_CHECK(!condition.timed_wait(lock, xt)); + // No one is going to notify this condition variable. We expect it to + // usually time out. It may occasionally return true due to a spurious wakeup. + bool wait_result = true; + for (unsigned int attempt = 0u; wait_result && attempt < max_wait_attempts; ++attempt) + wait_result = condition.timed_wait(lock, xt); + BOOST_CHECK(!wait_result); BOOST_CHECK(lock ? true : false); // Test the lock, unlock and trylock methods. @@ -222,8 +230,8 @@ struct test_timedlock boost::system_time timeout = boost::get_system_time()+boost::posix_time::milliseconds(100); // Test the lock and the mutex with condition variables. - // No one is going to notify this condition variable. We expect to - // time out. + // No one is going to notify this condition variable. We expect it to + // time out. Spurious wakeups should be handled by means of the predicate. BOOST_CHECK(!condition.timed_wait(lock, timeout, fake_predicate)); BOOST_CHECK(lock ? true : false); @@ -338,6 +346,3 @@ BOOST_AUTO_TEST_CASE(test_recursive_timed_mutex) { timed_test(&do_test_recursive_timed_mutex, 3); } - - - From d5c457aa4a012e63d0b2274f87b43ac620a9bbeb Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 1 Jul 2026 11:04:36 +0300 Subject: [PATCH 57/80] Increased timeouts in thread tests to avoid test failures in CI. --- test/test_thread.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test_thread.cpp b/test/test_thread.cpp index 8706cd9a2a..b23a57f7f0 100644 --- a/test/test_thread.cpp +++ b/test/test_thread.cpp @@ -62,7 +62,7 @@ void do_test_creation() BOOST_AUTO_TEST_CASE(test_creation) { - timed_test(&do_test_creation, 1); + timed_test(&do_test_creation, 2); } void do_test_id_comparison() @@ -74,7 +74,7 @@ void do_test_id_comparison() BOOST_AUTO_TEST_CASE(test_id_comparison) { - timed_test(&do_test_id_comparison, 1); + timed_test(&do_test_id_comparison, 2); } void interruption_point_thread(boost::mutex* m,bool* failed) @@ -98,7 +98,7 @@ void do_test_thread_interrupts_at_interruption_point() BOOST_AUTO_TEST_CASE(test_thread_interrupts_at_interruption_point) { - timed_test(&do_test_thread_interrupts_at_interruption_point, 1); + timed_test(&do_test_thread_interrupts_at_interruption_point, 2); } void disabled_interruption_point_thread(boost::mutex* m,bool* failed) @@ -123,7 +123,7 @@ void do_test_thread_no_interrupt_if_interrupts_disabled_at_interruption_point() BOOST_AUTO_TEST_CASE(test_thread_no_interrupt_if_interrupts_disabled_at_interruption_point) { - timed_test(&do_test_thread_no_interrupt_if_interrupts_disabled_at_interruption_point, 1); + timed_test(&do_test_thread_no_interrupt_if_interrupts_disabled_at_interruption_point, 2); } struct non_copyable_functor: From c8c283c1e7ef3b64f627473bfc2e8c7ba9435aa3 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 1 Jul 2026 13:08:13 +0300 Subject: [PATCH 58/80] Adjusted timeouts in wait tests for futures to improve CI reliability. --- test/sync/futures/future/wait_for_pass.cpp | 12 ++++++------ test/sync/futures/future/wait_until_pass.cpp | 12 ++++++------ test/sync/futures/shared_future/wait_for_pass.cpp | 12 ++++++------ test/sync/futures/shared_future/wait_until_pass.cpp | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/test/sync/futures/future/wait_for_pass.cpp b/test/sync/futures/future/wait_for_pass.cpp index e0ec2a6717..10a99b52b4 100644 --- a/test/sync/futures/future/wait_for_pass.cpp +++ b/test/sync/futures/future/wait_for_pass.cpp @@ -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(); diff --git a/test/sync/futures/future/wait_until_pass.cpp b/test/sync/futures/future/wait_until_pass.cpp index 0457900bc4..0a34fec70a 100644 --- a/test/sync/futures/future/wait_until_pass.cpp +++ b/test/sync/futures/future/wait_until_pass.cpp @@ -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(); diff --git a/test/sync/futures/shared_future/wait_for_pass.cpp b/test/sync/futures/shared_future/wait_for_pass.cpp index 48ae5e2a90..7e535eb07d 100644 --- a/test/sync/futures/shared_future/wait_for_pass.cpp +++ b/test/sync/futures/shared_future/wait_for_pass.cpp @@ -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(); diff --git a/test/sync/futures/shared_future/wait_until_pass.cpp b/test/sync/futures/shared_future/wait_until_pass.cpp index 9c6ceaeacb..5a8bd5e6a9 100644 --- a/test/sync/futures/shared_future/wait_until_pass.cpp +++ b/test/sync/futures/shared_future/wait_until_pass.cpp @@ -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(); From 7bcb46a9c70019299215f86f355aea9f3482e3d6 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 1 Jul 2026 19:11:14 +0300 Subject: [PATCH 59/80] Avoid relying on timeouts in try_lock_until tests for lock types. Directly compare the absolute timeouts that are passed to try_lock_until calls with the expected values. This makes the tests more reliable. --- .../locking/try_lock_until_pass.cpp | 21 ++++++++++++------ .../locking/try_lock_until_pass.cpp | 22 ++++++++++++------- .../locking/try_lock_until_pass.cpp | 21 ++++++++++++------ 3 files changed, 42 insertions(+), 22 deletions(-) diff --git a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp index 8d4463a4be..528073b634 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp @@ -22,6 +22,11 @@ #include #include #include +#include +#include + +typedef boost::chrono::steady_clock clock_type; +clock_type::time_point g_abs_timeout; bool try_lock_until_called = false; @@ -30,8 +35,7 @@ struct shared_mutex template bool try_lock_shared_until(const boost::chrono::time_point& abs_time) { - typedef boost::chrono::milliseconds ms; - BOOST_TEST(Clock::now() - abs_time < ms(5)); + BOOST_TEST(abs_time == g_abs_timeout); try_lock_until_called = !try_lock_until_called; return try_lock_until_called; } @@ -44,14 +48,15 @@ shared_mutex g_mutex; int main() { - typedef boost::chrono::steady_clock Clock; boost::shared_lock lk(g_mutex, boost::defer_lock); - BOOST_TEST(lk.try_lock_until(Clock::now()) == true); + g_abs_timeout = clock_type::now(); + BOOST_TEST(lk.try_lock_until((clock_type::time_point)g_abs_timeout) == true); BOOST_TEST(try_lock_until_called == true); BOOST_TEST(lk.owns_lock() == true); try { - lk.try_lock_until(Clock::now()); + g_abs_timeout = clock_type::now(); + lk.try_lock_until((clock_type::time_point)g_abs_timeout); BOOST_TEST(false); } catch (boost::system::system_error& e) @@ -59,13 +64,15 @@ int main() BOOST_TEST(e.code().value() == boost::system::errc::resource_deadlock_would_occur); } lk.unlock(); - BOOST_TEST(lk.try_lock_until(Clock::now()) == false); + g_abs_timeout = clock_type::now(); + BOOST_TEST(lk.try_lock_until((clock_type::time_point)g_abs_timeout) == false); BOOST_TEST(try_lock_until_called == false); BOOST_TEST(lk.owns_lock() == false); lk.release(); try { - lk.try_lock_until(Clock::now()); + g_abs_timeout = clock_type::now(); + lk.try_lock_until((clock_type::time_point)g_abs_timeout); BOOST_TEST(false); } catch (boost::system::system_error& e) diff --git a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp index ad9e224dc4..90af57296c 100644 --- a/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp @@ -25,6 +25,11 @@ #if defined BOOST_THREAD_USES_CHRONO +#include +#include + +typedef boost::chrono::steady_clock clock_type; +clock_type::time_point g_abs_timeout; bool try_lock_until_called = false; @@ -33,8 +38,7 @@ struct mutex template bool try_lock_until(const boost::chrono::time_point& abs_time) { - typedef boost::chrono::milliseconds ms; - BOOST_TEST(Clock::now() - abs_time < ms(5)); + BOOST_TEST(abs_time == g_abs_timeout); try_lock_until_called = !try_lock_until_called; return try_lock_until_called; } @@ -47,14 +51,15 @@ mutex g_mutex; int main() { - typedef boost::chrono::steady_clock Clock; boost::unique_lock lk(g_mutex, boost::defer_lock); - BOOST_TEST(lk.try_lock_until(Clock::now()) == true); + g_abs_timeout = clock_type::now(); + BOOST_TEST(lk.try_lock_until((clock_type::time_point)g_abs_timeout) == true); BOOST_TEST(try_lock_until_called == true); BOOST_TEST(lk.owns_lock() == true); try { - lk.try_lock_until(Clock::now()); + g_abs_timeout = clock_type::now(); + lk.try_lock_until((clock_type::time_point)g_abs_timeout); BOOST_TEST(false); } catch (boost::system::system_error& e) @@ -62,13 +67,15 @@ int main() BOOST_TEST(e.code().value() == boost::system::errc::resource_deadlock_would_occur); } lk.unlock(); - BOOST_TEST(lk.try_lock_until(Clock::now()) == false); + g_abs_timeout = clock_type::now(); + BOOST_TEST(lk.try_lock_until((clock_type::time_point)g_abs_timeout) == false); BOOST_TEST(try_lock_until_called == false); BOOST_TEST(lk.owns_lock() == false); lk.release(); try { - lk.try_lock_until(Clock::now()); + g_abs_timeout = clock_type::now(); + lk.try_lock_until((clock_type::time_point)g_abs_timeout); BOOST_TEST(false); } catch (boost::system::system_error& e) @@ -81,4 +88,3 @@ int main() #else #error "Test not applicable: BOOST_THREAD_USES_CHRONO not defined for this platform as not supported" #endif - diff --git a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp index 41748a314f..3ec7886090 100644 --- a/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp +++ b/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp @@ -22,6 +22,11 @@ #include #include #include +#include +#include + +typedef boost::chrono::steady_clock clock_type; +clock_type::time_point g_abs_timeout; bool try_lock_until_called = false; @@ -30,8 +35,7 @@ struct shared_mutex template bool try_lock_upgrade_until(const boost::chrono::time_point& abs_time) { - typedef boost::chrono::milliseconds ms; - BOOST_TEST(Clock::now() - abs_time < ms(5)); + BOOST_TEST(abs_time == g_abs_timeout); try_lock_until_called = !try_lock_until_called; return try_lock_until_called; } @@ -44,14 +48,15 @@ shared_mutex g_mutex; int main() { - typedef boost::chrono::steady_clock Clock; boost::upgrade_lock lk(g_mutex, boost::defer_lock); - BOOST_TEST(lk.try_lock_until(Clock::now()) == true); + g_abs_timeout = clock_type::now(); + BOOST_TEST(lk.try_lock_until((clock_type::time_point)g_abs_timeout) == true); BOOST_TEST(try_lock_until_called == true); BOOST_TEST(lk.owns_lock() == true); try { - lk.try_lock_until(Clock::now()); + g_abs_timeout = clock_type::now(); + lk.try_lock_until((clock_type::time_point)g_abs_timeout); BOOST_TEST(false); } catch (boost::system::system_error& e) @@ -59,13 +64,15 @@ int main() BOOST_TEST(e.code().value() == boost::system::errc::resource_deadlock_would_occur); } lk.unlock(); - BOOST_TEST(lk.try_lock_until(Clock::now()) == false); + g_abs_timeout = clock_type::now(); + BOOST_TEST(lk.try_lock_until((clock_type::time_point)g_abs_timeout) == false); BOOST_TEST(try_lock_until_called == false); BOOST_TEST(lk.owns_lock() == false); lk.release(); try { - lk.try_lock_until(Clock::now()); + g_abs_timeout = clock_type::now(); + lk.try_lock_until((clock_type::time_point)g_abs_timeout); BOOST_TEST(false); } catch (boost::system::system_error& e) From 3b4615d9e7ba30a23d067392b9c1ba0f46600f6f Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 2 Jul 2026 18:10:28 +0300 Subject: [PATCH 60/80] Increased timeouts in condition variable notify tests. Also made reading the waiting flag thread-safe in the notify tests. --- .../condition_variable/lost_notif_pass.cpp | 20 +++++++++++-------- .../lost_notif_pass.cpp | 20 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/test/sync/conditions/condition_variable/lost_notif_pass.cpp b/test/sync/conditions/condition_variable/lost_notif_pass.cpp index a79a7dce26..8b54c82843 100644 --- a/test/sync/conditions/condition_variable/lost_notif_pass.cpp +++ b/test/sync/conditions/condition_variable/lost_notif_pass.cpp @@ -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 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 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 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 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 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 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)); } //------------------------------------------------------------------------------ diff --git a/test/sync/conditions/condition_variable_any/lost_notif_pass.cpp b/test/sync/conditions/condition_variable_any/lost_notif_pass.cpp index 08cb176027..d4fc7b8ade 100644 --- a/test/sync/conditions/condition_variable_any/lost_notif_pass.cpp +++ b/test/sync/conditions/condition_variable_any/lost_notif_pass.cpp @@ -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 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 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 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 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 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 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)); } //------------------------------------------------------------------------------ From 78190abb18af8830d76b5d5fc255e6d3d9e1a177 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 2 Jul 2026 19:08:13 +0300 Subject: [PATCH 61/80] Avoid relying on timeouts in when_all/when_any tests. Use thread barriers to synchronize between the main and async threads instead of relying on timeouts. This should make these tests more reliable in CI. --- test/sync/futures/when_all/iterators_pass.cpp | 44 ++++++------- test/sync/futures/when_all/variadic_pass.cpp | 37 ++++++----- test/sync/futures/when_any/iterators_pass.cpp | 63 +++++++++++-------- test/sync/futures/when_any/variadic_pass.cpp | 58 ++++++++++------- 4 files changed, 113 insertions(+), 89 deletions(-) diff --git a/test/sync/futures/when_all/iterators_pass.cpp b/test/sync/futures/when_all/iterators_pass.cpp index c13b8064e1..5cc72b77c4 100644 --- a/test/sync/futures/when_all/iterators_pass.cpp +++ b/test/sync/futures/when_all/iterators_pass.cpp @@ -332,28 +332,28 @@ int main() } #endif #if ! defined BOOST_NO_CXX11_LAMBDAS - { // async futures copy-constructible then() - boost::future f1 = boost::async(boost::launch::async, &p1); - BOOST_TEST(f1.valid()); - boost::future f2 = boost::async(boost::launch::async, &p2); - BOOST_TEST(f2.valid()); - boost::csbl::vector > v; - v.push_back(boost::move(f1)); - v.push_back(boost::move(f2)); - BOOST_TEST(v[0].valid()); - BOOST_TEST(v[1].valid()); - boost::future > > all = boost::when_all(v.begin(), v.end()); - BOOST_TEST(! v[0].valid()); - BOOST_TEST(! v[1].valid()); - BOOST_TEST(all.valid()); - boost::future sum = all.then([](boost::future > > f) - { - boost::csbl::vector > v = f.get(); - return v[0].get() + v[1].get(); - }); - BOOST_TEST(sum.valid()); - BOOST_TEST(sum.get() == 444); - } + { // async futures copy-constructible then() + boost::future f1 = boost::async(boost::launch::async, &p1); + BOOST_TEST(f1.valid()); + boost::future f2 = boost::async(boost::launch::async, &p2); + BOOST_TEST(f2.valid()); + boost::csbl::vector > v; + v.push_back(boost::move(f1)); + v.push_back(boost::move(f2)); + BOOST_TEST(v[0].valid()); + BOOST_TEST(v[1].valid()); + boost::future > > all = boost::when_all(v.begin(), v.end()); + BOOST_TEST(! v[0].valid()); + BOOST_TEST(! v[1].valid()); + BOOST_TEST(all.valid()); + boost::future sum = all.then([](boost::future > > f) + { + boost::csbl::vector > v = f.get(); + return v[0].get() + v[1].get(); + }); + BOOST_TEST(sum.valid()); + BOOST_TEST(sum.get() == 444); + } #endif #endif diff --git a/test/sync/futures/when_all/variadic_pass.cpp b/test/sync/futures/when_all/variadic_pass.cpp index 205776fa3e..e4b2e2d8b9 100644 --- a/test/sync/futures/when_all/variadic_pass.cpp +++ b/test/sync/futures/when_all/variadic_pass.cpp @@ -36,7 +36,6 @@ int p1() { - boost::this_thread::sleep_for(boost::chrono::milliseconds(100)); return 123; } @@ -44,9 +43,9 @@ int thr() { throw std::logic_error("123"); } + int p2() { - boost::this_thread::sleep_for(boost::chrono::milliseconds(200)); return 321; } @@ -275,23 +274,23 @@ int main() } #endif #if ! defined BOOST_NO_CXX11_LAMBDAS - { // async futures copy-constructible then() - boost::future f1 = boost::async(boost::launch::async, &p1); - BOOST_TEST(f1.valid()); - boost::future f2 = boost::async(boost::launch::async, &p2); - BOOST_TEST(f2.valid()); - boost::future,boost::future > > all = boost::when_all(boost::move(f1), boost::move(f2)); - BOOST_TEST(! f1.valid()); - BOOST_TEST(! f2.valid()); - BOOST_TEST(all.valid()); - boost::future sum = all.then([](boost::future, boost::future > > f) - { - boost::csbl::tuple,boost::future > v = f.get(); - return boost::csbl::get<0>(v).get()+boost::csbl::get<1>(v).get(); - }); - BOOST_TEST(sum.valid()); - BOOST_TEST(sum.get() == 444); - } + { // async futures copy-constructible then() + boost::future f1 = boost::async(boost::launch::async, &p1); + BOOST_TEST(f1.valid()); + boost::future f2 = boost::async(boost::launch::async, &p2); + BOOST_TEST(f2.valid()); + boost::future,boost::future > > all = boost::when_all(boost::move(f1), boost::move(f2)); + BOOST_TEST(! f1.valid()); + BOOST_TEST(! f2.valid()); + BOOST_TEST(all.valid()); + boost::future sum = all.then([](boost::future, boost::future > > f) + { + boost::csbl::tuple,boost::future > v = f.get(); + return boost::csbl::get<0>(v).get()+boost::csbl::get<1>(v).get(); + }); + BOOST_TEST(sum.valid()); + BOOST_TEST(sum.get() == 444); + } #endif #endif diff --git a/test/sync/futures/when_any/iterators_pass.cpp b/test/sync/futures/when_any/iterators_pass.cpp index d33ebd191a..55a86fd2a6 100644 --- a/test/sync/futures/when_any/iterators_pass.cpp +++ b/test/sync/futures/when_any/iterators_pass.cpp @@ -28,6 +28,7 @@ #define BOOST_THREAD_VERSION 4 #include +#include #include #include @@ -44,9 +45,16 @@ int thr() { throw std::logic_error("123"); } + int p2() { - boost::this_thread::sleep_for(boost::chrono::milliseconds(200)); + return 321; +} + +int p3(boost::barrier* bar = nullptr) +{ + if (bar) + bar->count_down_and_wait(); return 321; } @@ -217,9 +225,10 @@ int main() BOOST_TEST(res[1].get() == 321); } { // async future copy-constructible + boost::barrier bar(2u); boost::future f1 = boost::async(boost::launch::async, &p1); BOOST_TEST(f1.valid()); - boost::future f2 = boost::async(boost::launch::async, &p2); + boost::future f2 = boost::async(boost::launch::async, &p3, &bar); BOOST_TEST(f2.valid()); boost::csbl::vector > v; v.push_back(boost::move(f1)); @@ -236,12 +245,14 @@ int main() BOOST_TEST(res[0].get() == 123); BOOST_TEST(res[1].valid()); BOOST_TEST(! res[1].is_ready()); + bar.count_down_and_wait(); BOOST_TEST(res[1].get() == 321); } { // async shared_future copy-constructible + boost::barrier bar(2u); boost::shared_future f1 = boost::async(boost::launch::async, &p1).share(); BOOST_TEST(f1.valid()); - boost::shared_future f2 = boost::async(boost::launch::async, &p2).share(); + boost::shared_future f2 = boost::async(boost::launch::async, &p3, &bar).share(); BOOST_TEST(f2.valid()); boost::csbl::vector > v; v.push_back(f1); @@ -260,6 +271,7 @@ int main() BOOST_TEST(res[0].get() == 123); BOOST_TEST(res[1].valid()); BOOST_TEST(! res[1].is_ready()); + bar.count_down_and_wait(); BOOST_TEST(res[1].get() == 321); } { // async future copy-constructible @@ -333,31 +345,30 @@ int main() } #endif #if ! defined BOOST_NO_CXX11_LAMBDAS - { // async futures copy-constructible then() - boost::future f1 = boost::async(boost::launch::async, &p1); - BOOST_TEST(f1.valid()); - boost::future f2 = boost::async(boost::launch::async, &p2); - BOOST_TEST(f2.valid()); - boost::csbl::vector > v; - v.push_back(boost::move(f1)); - v.push_back(boost::move(f2)); - BOOST_TEST(v[0].valid()); - BOOST_TEST(v[1].valid()); - boost::future > > all = boost::when_any(v.begin(), v.end()); - BOOST_TEST(! v[0].valid()); - BOOST_TEST(! v[1].valid()); - BOOST_TEST(all.valid()); - boost::future sum = all.then([](boost::future > > f) - { - boost::csbl::vector > v = f.get(); - return v[0].get() + v[1].get(); - }); - BOOST_TEST(sum.valid()); - BOOST_TEST(sum.get() == 444); - } + { // async futures copy-constructible then() + boost::future f1 = boost::async(boost::launch::async, &p1); + BOOST_TEST(f1.valid()); + boost::future f2 = boost::async(boost::launch::async, &p2); + BOOST_TEST(f2.valid()); + boost::csbl::vector > v; + v.push_back(boost::move(f1)); + v.push_back(boost::move(f2)); + BOOST_TEST(v[0].valid()); + BOOST_TEST(v[1].valid()); + boost::future > > all = boost::when_any(v.begin(), v.end()); + BOOST_TEST(! v[0].valid()); + BOOST_TEST(! v[1].valid()); + BOOST_TEST(all.valid()); + boost::future sum = all.then([](boost::future > > f) + { + boost::csbl::vector > v = f.get(); + return v[0].get() + v[1].get(); + }); + BOOST_TEST(sum.valid()); + BOOST_TEST(sum.get() == 444); + } #endif #endif return boost::report_errors(); } - diff --git a/test/sync/futures/when_any/variadic_pass.cpp b/test/sync/futures/when_any/variadic_pass.cpp index 9d12ccf844..2d831427e1 100644 --- a/test/sync/futures/when_any/variadic_pass.cpp +++ b/test/sync/futures/when_any/variadic_pass.cpp @@ -26,6 +26,7 @@ #define BOOST_THREAD_VERSION 4 #include +#include #include #include @@ -42,9 +43,16 @@ int thr() { throw std::logic_error("123"); } + int p2() { - boost::this_thread::sleep_for(boost::chrono::milliseconds(200)); + return 321; +} + +int p3(boost::barrier* bar = nullptr) +{ + if (bar) + bar->count_down_and_wait(); return 321; } @@ -180,9 +188,10 @@ int main() BOOST_TEST(boost::csbl::get<1>(res).get() == 321); } { // async future copy-constructible + boost::barrier bar(2u); boost::future f1 = boost::async(boost::launch::async, &p1); BOOST_TEST(f1.valid()); - boost::future f2 = boost::async(boost::launch::async, &p2); + boost::future f2 = boost::async(boost::launch::async, &p3, &bar); BOOST_TEST(f2.valid()); boost::future,boost::future > > all = boost::when_any(boost::move(f1), boost::move(f2)); BOOST_TEST(! f1.valid()); @@ -192,12 +201,14 @@ int main() BOOST_TEST(boost::csbl::get<0>(res).valid()); BOOST_TEST(boost::csbl::get<0>(res).is_ready() || boost::csbl::get<1>(res).is_ready()); BOOST_TEST(boost::csbl::get<0>(res).get() == 123); + bar.count_down_and_wait(); BOOST_TEST(boost::csbl::get<1>(res).get() == 321); } { // async shared_future copy-constructible + boost::barrier bar(2u); boost::shared_future f1 = boost::async(boost::launch::async, &p1).share(); BOOST_TEST(f1.valid()); - boost::shared_future f2 = boost::async(boost::launch::async, &p2).share(); + boost::shared_future f2 = boost::async(boost::launch::async, &p3, &bar).share(); BOOST_TEST(f2.valid()); boost::future,boost::shared_future > > all = boost::when_any(f1, f2); BOOST_TEST(f1.valid()); @@ -208,6 +219,7 @@ int main() BOOST_TEST(boost::csbl::get<1>(res).valid()); BOOST_TEST(boost::csbl::get<0>(res).is_ready() || boost::csbl::get<1>(res).is_ready()); BOOST_TEST(boost::csbl::get<0>(res).get() == 123); + bar.count_down_and_wait(); BOOST_TEST(boost::csbl::get<1>(res).get() == 321); } { // async future copy-constructible @@ -251,8 +263,9 @@ int main() } // fixme darwin-4.8.0_11 terminate called without an active exception { // deferred future copy-constructible + boost::barrier bar(2u); boost::future f1 = boost::async(boost::launch::deferred, &p1); - boost::future f2 = boost::async(boost::launch::async, &p2); + boost::future f2 = boost::async(boost::launch::async, &p3, &bar); boost::future,boost::future > > all = boost::when_any(boost::move(f1), boost::move(f2)); BOOST_TEST(! f1.valid()); BOOST_TEST(! f2.valid()); @@ -262,7 +275,8 @@ int main() BOOST_TEST(boost::csbl::get<0>(res).is_ready()); BOOST_TEST(boost::csbl::get<0>(res).get() == 123); BOOST_TEST(boost::csbl::get<1>(res).valid()); - //BOOST_TEST(! boost::csbl::get<1>(res).is_ready()); + BOOST_TEST(! boost::csbl::get<1>(res).is_ready()); + bar.count_down_and_wait(); BOOST_TEST(boost::csbl::get<1>(res).get() == 321); } // fixme darwin-4.8.0_11 terminate called without an active exception @@ -298,23 +312,23 @@ int main() } #endif #if ! defined BOOST_NO_CXX11_LAMBDAS - { // async futures copy-constructible then() - boost::future f1 = boost::async(boost::launch::async, &p1); - BOOST_TEST(f1.valid()); - boost::future f2 = boost::async(boost::launch::async, &p2); - BOOST_TEST(f2.valid()); - boost::future,boost::future > > all = boost::when_any(boost::move(f1), boost::move(f2)); - BOOST_TEST(! f1.valid()); - BOOST_TEST(! f2.valid()); - BOOST_TEST(all.valid()); - boost::future sum = all.then([](boost::future, boost::future > > f) - { - boost::csbl::tuple,boost::future > v = f.get(); - return boost::csbl::get<0>(v).get()+boost::csbl::get<1>(v).get(); - }); - BOOST_TEST(sum.valid()); - BOOST_TEST(sum.get() == 444); - } + { // async futures copy-constructible then() + boost::future f1 = boost::async(boost::launch::async, &p1); + BOOST_TEST(f1.valid()); + boost::future f2 = boost::async(boost::launch::async, &p2); + BOOST_TEST(f2.valid()); + boost::future,boost::future > > all = boost::when_any(boost::move(f1), boost::move(f2)); + BOOST_TEST(! f1.valid()); + BOOST_TEST(! f2.valid()); + BOOST_TEST(all.valid()); + boost::future sum = all.then([](boost::future, boost::future > > f) + { + boost::csbl::tuple,boost::future > v = f.get(); + return boost::csbl::get<0>(v).get()+boost::csbl::get<1>(v).get(); + }); + BOOST_TEST(sum.valid()); + BOOST_TEST(sum.get() == 444); + } #endif #endif From 79ebce23269c07e29c474baad3f554b6306915b5 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 2 Jul 2026 20:11:44 +0300 Subject: [PATCH 62/80] Provide a user-refined copy constructor in check_flag. This avoids a clang warning about the implicit copy constructor being deprecated when a user-defined assignment operator is provided. --- test/condition_test_common.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/condition_test_common.hpp b/test/condition_test_common.hpp index 4aa114e050..2e359c5c09 100644 --- a/test/condition_test_common.hpp +++ b/test/condition_test_common.hpp @@ -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&); }; From 53d49020f69600e2852e6fce0500fb9af00ab44e Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 2 Jul 2026 20:47:11 +0300 Subject: [PATCH 63/80] Fix deprecated implicit copy constructor warning in example. --- example/std_thread_guard.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/example/std_thread_guard.cpp b/example/std_thread_guard.cpp index ebf5a41738..feb746591e 100644 --- a/example/std_thread_guard.cpp +++ b/example/std_thread_guard.cpp @@ -26,6 +26,7 @@ struct func int& i; func(int& i_):i(i_){} + func(func const& that):i(that.i){} void operator()() { From 2f9ffdbb636f6d6de31085a91e4436a1116d2b67 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 2 Jul 2026 20:16:53 +0300 Subject: [PATCH 64/80] Removed unused local variables to avoid clang warnings. --- test/test_shared_mutex_timed_locks.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/test_shared_mutex_timed_locks.cpp b/test/test_shared_mutex_timed_locks.cpp index c29c4260c8..a9e240c176 100644 --- a/test/test_shared_mutex_timed_locks.cpp +++ b/test/test_shared_mutex_timed_locks.cpp @@ -63,7 +63,6 @@ BOOST_AUTO_TEST_CASE(test_timed_lock_shared_succeeds_if_no_lock_held) boost::system_time const start=boost::get_system_time(); boost::system_time const timeout=start+boost::posix_time::milliseconds(500); - boost::posix_time::milliseconds const timeout_resolution(50); bool timed_lock_succeeded=rw_mutex.timed_lock_shared(timeout); BOOST_CHECK(boost::get_system_time() Date: Thu, 2 Jul 2026 20:22:53 +0300 Subject: [PATCH 65/80] Fix uninitialized variable warnings. --- .../sync_bounded_queue/single_thread_pass.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp index ee8acc57fe..6dd6d20093 100644 --- a/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp @@ -411,7 +411,7 @@ int main() { // empty queue wait_push value succeeds boost::sync_bounded_queue q(2); - int i; + int i = 42; BOOST_TEST(boost::queue_op_status::success == q.wait_push_back(i)); BOOST_TEST(! q.empty()); BOOST_TEST(! q.full()); @@ -590,7 +590,7 @@ int main() q.close(); BOOST_TEST(q.empty()); BOOST_TEST(q.closed()); - int i; + int i = 42; BOOST_TEST(boost::queue_op_status::closed == q.wait_push_back(i)); BOOST_TEST(q.empty()); BOOST_TEST(q.closed()); From 04da999e577b440772c49981d69d43f7891416d8 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 2 Jul 2026 20:51:38 +0300 Subject: [PATCH 66/80] Silenced unused variable warnings. --- example/producer_consumer.cpp | 3 +++ example/producer_consumer2.cpp | 3 +++ example/producer_consumer_bounded.cpp | 2 ++ 3 files changed, 8 insertions(+) diff --git a/example/producer_consumer.cpp b/example/producer_consumer.cpp index 73ad04fb72..4917ea0efa 100644 --- a/example/producer_consumer.cpp +++ b/example/producer_consumer.cpp @@ -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 & 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 & 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; diff --git a/example/producer_consumer2.cpp b/example/producer_consumer2.cpp index a8264a9bbc..b765b4d924 100644 --- a/example/producer_consumer2.cpp +++ b/example/producer_consumer2.cpp @@ -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 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 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; diff --git a/example/producer_consumer_bounded.cpp b/example/producer_consumer_bounded.cpp index 70158a3e94..0d8d04f380 100644 --- a/example/producer_consumer_bounded.cpp +++ b/example/producer_consumer_bounded.cpp @@ -55,6 +55,7 @@ void consumer(the_ostream &/*mos*/, boost::sync_bounded_queue & 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 & 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; From 55cbdeefe4d6f7e829e30bba84129b2b5a38e294 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 2 Jul 2026 20:54:48 +0300 Subject: [PATCH 67/80] Silenced unused variable warning. --- test/sync/conditions/condition_variable/wait_for_pred_pass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp b/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp index bfc5555f0b..d05cf76566 100644 --- a/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp +++ b/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp @@ -56,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() { From 1ce6bceadf01f2b24e9f562416998e46ce813490 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 1 Jul 2026 10:55:33 +0300 Subject: [PATCH 68/80] Added checks for the malloc call results in operator new. The operator new is not supposed to return null pointers, so throw bad_alloc when malloc returns null. This should avoid segmentation faults if malloc fails. --- test/threads/thread/constr/FArgs_pass.cpp | 4 +++- test/threads/thread/constr/F_pass.cpp | 4 +++- test/threads/thread/constr/lambda_pass.cpp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/test/threads/thread/constr/FArgs_pass.cpp b/test/threads/thread/constr/FArgs_pass.cpp index 6de724deff..bc68672b05 100644 --- a/test/threads/thread/constr/FArgs_pass.cpp +++ b/test/threads/thread/constr/FArgs_pass.cpp @@ -40,7 +40,9 @@ void* operator new(std::size_t s) throw (std::bad_alloc) //std::cout << __FILE__ << ":" << __LINE__ << std::endl; if (throw_one == 0) throw std::bad_alloc(); --throw_one; - return std::malloc(s); + void* p = std::malloc(s); + if (!p) throw std::bad_alloc(); + return p; } #if defined BOOST_MSVC diff --git a/test/threads/thread/constr/F_pass.cpp b/test/threads/thread/constr/F_pass.cpp index ee405394b8..7da47402d5 100644 --- a/test/threads/thread/constr/F_pass.cpp +++ b/test/threads/thread/constr/F_pass.cpp @@ -40,7 +40,9 @@ void* operator new(std::size_t s) throw (std::bad_alloc) //std::cout << __FILE__ << ":" << __LINE__ << std::endl; if (throw_one == 0) throw std::bad_alloc(); --throw_one; - return std::malloc(s); + void* p = std::malloc(s); + if (!p) throw std::bad_alloc(); + return p; } #if defined BOOST_MSVC diff --git a/test/threads/thread/constr/lambda_pass.cpp b/test/threads/thread/constr/lambda_pass.cpp index d5af13f296..5cffc2aed0 100644 --- a/test/threads/thread/constr/lambda_pass.cpp +++ b/test/threads/thread/constr/lambda_pass.cpp @@ -41,7 +41,9 @@ void* operator new(std::size_t s) throw (std::bad_alloc) { if (throw_one == 0) throw std::bad_alloc(); --throw_one; - return std::malloc(s); + void* p = std::malloc(s); + if (!p) throw std::bad_alloc(); + return p; } #if defined BOOST_MSVC From 031406d2f355dfa21926f1bf763b566e1bd526ea Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 1 Jul 2026 13:24:30 +0300 Subject: [PATCH 69/80] Removed exception specification from custom operator new overrides. The specifications are not necessary since C++11 anyway, and we no longer support C++03. --- test/threads/thread/constr/FArgs_pass.cpp | 6 +----- test/threads/thread/constr/F_pass.cpp | 6 +----- test/threads/thread/constr/lambda_pass.cpp | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/test/threads/thread/constr/FArgs_pass.cpp b/test/threads/thread/constr/FArgs_pass.cpp index bc68672b05..dc72d231ce 100644 --- a/test/threads/thread/constr/FArgs_pass.cpp +++ b/test/threads/thread/constr/FArgs_pass.cpp @@ -29,12 +29,8 @@ unsigned throw_one = 0xFFFF; #if defined _GLIBCXX_THROW void* operator new(std::size_t s) _GLIBCXX_THROW (std::bad_alloc) -#elif defined BOOST_MSVC -void* operator new(std::size_t s) -#elif __cplusplus > 201402L -void* operator new(std::size_t s) #else -void* operator new(std::size_t s) throw (std::bad_alloc) +void* operator new(std::size_t s) #endif { //std::cout << __FILE__ << ":" << __LINE__ << std::endl; diff --git a/test/threads/thread/constr/F_pass.cpp b/test/threads/thread/constr/F_pass.cpp index 7da47402d5..4289156c52 100644 --- a/test/threads/thread/constr/F_pass.cpp +++ b/test/threads/thread/constr/F_pass.cpp @@ -29,12 +29,8 @@ unsigned throw_one = 0xFFFF; #if defined _GLIBCXX_THROW void* operator new(std::size_t s) _GLIBCXX_THROW (std::bad_alloc) -#elif defined BOOST_MSVC -void* operator new(std::size_t s) -#elif __cplusplus > 201402L -void* operator new(std::size_t s) #else -void* operator new(std::size_t s) throw (std::bad_alloc) +void* operator new(std::size_t s) #endif { //std::cout << __FILE__ << ":" << __LINE__ << std::endl; diff --git a/test/threads/thread/constr/lambda_pass.cpp b/test/threads/thread/constr/lambda_pass.cpp index 5cffc2aed0..38b0cc0a96 100644 --- a/test/threads/thread/constr/lambda_pass.cpp +++ b/test/threads/thread/constr/lambda_pass.cpp @@ -31,12 +31,8 @@ unsigned throw_one = 0xFFFF; #if defined _GLIBCXX_THROW void* operator new(std::size_t s) _GLIBCXX_THROW (std::bad_alloc) -#elif defined BOOST_MSVC -void* operator new(std::size_t s) -#elif __cplusplus > 201402L -void* operator new(std::size_t s) #else -void* operator new(std::size_t s) throw (std::bad_alloc) +void* operator new(std::size_t s) #endif { if (throw_one == 0) throw std::bad_alloc(); From 5a5554a3a6ebc095059d81873d2eed9f93277286 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 1 Jul 2026 20:56:53 +0300 Subject: [PATCH 70/80] Avoid recursively throwing an exception from a custom operator new. Allocating an exception object may recursively call our custom operator new, which would result in an infinite recursion and a crash. So only initiate the throw when the operator is called non-recursively. Otherwise, let the memory allocation proceed using malloc. --- test/threads/thread/constr/FArgs_pass.cpp | 33 +++++++++++++++++++--- test/threads/thread/constr/F_pass.cpp | 33 +++++++++++++++++++--- test/threads/thread/constr/lambda_pass.cpp | 33 +++++++++++++++++++--- 3 files changed, 87 insertions(+), 12 deletions(-) diff --git a/test/threads/thread/constr/FArgs_pass.cpp b/test/threads/thread/constr/FArgs_pass.cpp index dc72d231ce..792dba724b 100644 --- a/test/threads/thread/constr/FArgs_pass.cpp +++ b/test/threads/thread/constr/FArgs_pass.cpp @@ -25,7 +25,20 @@ #include #include -unsigned throw_one = 0xFFFF; +thread_local unsigned throw_one = 0xFFFF; +thread_local unsigned operator_new_recursion_level = 0u; + +struct operator_new_recursion_counter +{ + operator_new_recursion_counter() BOOST_NOEXCEPT_OR_NOTHROW + { + ++operator_new_recursion_level; + } + ~operator_new_recursion_counter() BOOST_NOEXCEPT_OR_NOTHROW + { + --operator_new_recursion_level; + } +}; #if defined _GLIBCXX_THROW void* operator new(std::size_t s) _GLIBCXX_THROW (std::bad_alloc) @@ -34,10 +47,22 @@ void* operator new(std::size_t s) #endif { //std::cout << __FILE__ << ":" << __LINE__ << std::endl; - if (throw_one == 0) throw std::bad_alloc(); - --throw_one; + // Throwing an exception may recursively call operator new. If we're throwing std::bad_alloc, + // this may cause infinite recursion and a crash. So only throw if we're at the top recursion level. + operator_new_recursion_counter auto_counter; + if (operator_new_recursion_level == 1u) + { + if (throw_one == 0) throw std::bad_alloc(); + --throw_one; + } void* p = std::malloc(s); - if (!p) throw std::bad_alloc(); + if (!p) + { + if (operator_new_recursion_level == 1u) + throw std::bad_alloc(); + else + std::abort(); + } return p; } diff --git a/test/threads/thread/constr/F_pass.cpp b/test/threads/thread/constr/F_pass.cpp index 4289156c52..5e2c1f6262 100644 --- a/test/threads/thread/constr/F_pass.cpp +++ b/test/threads/thread/constr/F_pass.cpp @@ -25,7 +25,20 @@ #include #include -unsigned throw_one = 0xFFFF; +thread_local unsigned throw_one = 0xFFFF; +thread_local unsigned operator_new_recursion_level = 0u; + +struct operator_new_recursion_counter +{ + operator_new_recursion_counter() BOOST_NOEXCEPT_OR_NOTHROW + { + ++operator_new_recursion_level; + } + ~operator_new_recursion_counter() BOOST_NOEXCEPT_OR_NOTHROW + { + --operator_new_recursion_level; + } +}; #if defined _GLIBCXX_THROW void* operator new(std::size_t s) _GLIBCXX_THROW (std::bad_alloc) @@ -34,10 +47,22 @@ void* operator new(std::size_t s) #endif { //std::cout << __FILE__ << ":" << __LINE__ << std::endl; - if (throw_one == 0) throw std::bad_alloc(); - --throw_one; + // Throwing an exception may recursively call operator new. If we're throwing std::bad_alloc, + // this may cause infinite recursion and a crash. So only throw if we're at the top recursion level. + operator_new_recursion_counter auto_counter; + if (operator_new_recursion_level == 1u) + { + if (throw_one == 0) throw std::bad_alloc(); + --throw_one; + } void* p = std::malloc(s); - if (!p) throw std::bad_alloc(); + if (!p) + { + if (operator_new_recursion_level == 1u) + throw std::bad_alloc(); + else + std::abort(); + } return p; } diff --git a/test/threads/thread/constr/lambda_pass.cpp b/test/threads/thread/constr/lambda_pass.cpp index 38b0cc0a96..78eeea8711 100644 --- a/test/threads/thread/constr/lambda_pass.cpp +++ b/test/threads/thread/constr/lambda_pass.cpp @@ -27,7 +27,20 @@ #if ! defined BOOST_NO_CXX11_LAMBDAS -unsigned throw_one = 0xFFFF; +thread_local unsigned throw_one = 0xFFFF; +thread_local unsigned operator_new_recursion_level = 0u; + +struct operator_new_recursion_counter +{ + operator_new_recursion_counter() BOOST_NOEXCEPT_OR_NOTHROW + { + ++operator_new_recursion_level; + } + ~operator_new_recursion_counter() BOOST_NOEXCEPT_OR_NOTHROW + { + --operator_new_recursion_level; + } +}; #if defined _GLIBCXX_THROW void* operator new(std::size_t s) _GLIBCXX_THROW (std::bad_alloc) @@ -35,10 +48,22 @@ void* operator new(std::size_t s) _GLIBCXX_THROW (std::bad_alloc) void* operator new(std::size_t s) #endif { - if (throw_one == 0) throw std::bad_alloc(); - --throw_one; + // Throwing an exception may recursively call operator new. If we're throwing std::bad_alloc, + // this may cause infinite recursion and a crash. So only throw if we're at the top recursion level. + operator_new_recursion_counter auto_counter; + if (operator_new_recursion_level == 1u) + { + if (throw_one == 0) throw std::bad_alloc(); + --throw_one; + } void* p = std::malloc(s); - if (!p) throw std::bad_alloc(); + if (!p) + { + if (operator_new_recursion_level == 1u) + throw std::bad_alloc(); + else + std::abort(); + } return p; } From fbeebd66ebd1f3ba2775aa5f152d4a2c481399cc Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 2 Jul 2026 20:38:43 +0300 Subject: [PATCH 71/80] On OpenBSD, disable thread ctor tests that throw from operator new. The tests crash with SIGSEGV when operator new throws for unknown reason. The constructor itself works as other, non-throwing tests pass. --- test/threads/thread/constr/FArgs_pass.cpp | 3 ++- test/threads/thread/constr/F_pass.cpp | 5 +++-- test/threads/thread/constr/lambda_pass.cpp | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/threads/thread/constr/FArgs_pass.cpp b/test/threads/thread/constr/FArgs_pass.cpp index 792dba724b..722a1cd08f 100644 --- a/test/threads/thread/constr/FArgs_pass.cpp +++ b/test/threads/thread/constr/FArgs_pass.cpp @@ -147,7 +147,8 @@ int main() BOOST_TEST(f_run == true); std::cout << __FILE__ << ":" << __LINE__ <<" " << G::n_alive << std::endl; } -#if !defined(BOOST_MSVC) && !defined(__MINGW32__) +// On OpenBSD, the test crashes for unknown reason when operator new throws an exception. +#if !defined(BOOST_MSVC) && !defined(__MINGW32__) && !defined(__OpenBSD__) f_run = false; { std::cout << __FILE__ << ":" << __LINE__ <<" " << G::n_alive << std::endl; diff --git a/test/threads/thread/constr/F_pass.cpp b/test/threads/thread/constr/F_pass.cpp index 5e2c1f6262..e13a87aed1 100644 --- a/test/threads/thread/constr/F_pass.cpp +++ b/test/threads/thread/constr/F_pass.cpp @@ -143,7 +143,8 @@ int main() BOOST_TEST(f_run == true); } f_run = false; -#if !defined(BOOST_MSVC) && !defined(__MINGW32__) +// On OpenBSD, the test crashes for unknown reason when operator new throws an exception. +#if !defined(BOOST_MSVC) && !defined(__MINGW32__) && !defined(__OpenBSD__) { try { @@ -166,7 +167,7 @@ int main() BOOST_TEST(G::n_alive == 0); BOOST_TEST(G::op_run); } -#if !defined(BOOST_MSVC) && !defined(__MINGW32__) +#if !defined(BOOST_MSVC) && !defined(__MINGW32__) && !defined(__OpenBSD__) G::op_run = false; { try diff --git a/test/threads/thread/constr/lambda_pass.cpp b/test/threads/thread/constr/lambda_pass.cpp index 78eeea8711..2097826850 100644 --- a/test/threads/thread/constr/lambda_pass.cpp +++ b/test/threads/thread/constr/lambda_pass.cpp @@ -102,7 +102,8 @@ int main() t.join(); BOOST_TEST(f_run == true); } -#if !defined(BOOST_MSVC) && !defined(__MINGW32__) +// On OpenBSD, the test crashes for unknown reason when operator new throws an exception. +#if !defined(BOOST_MSVC) && !defined(__MINGW32__) && !defined(__OpenBSD__) { f_run = false; try From 03db32830855e2b077a6602b818692f1c5c9fc01 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 3 Jul 2026 02:45:45 +0300 Subject: [PATCH 72/80] Increased max time differences in tests to improve CI reliability. Increased BOOST_THREAD_TEST_TIME_MS (a.k.a. max_diff) threshold that is used in many tests for checking wakeup time delays to 600 ms on systems other than Linux. This is to account increased delays on VMs that are used to run CI on BSD systems, which occasionally cause excessively long latencies in thread communication and wakeups. --- test/timming.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/timming.hpp b/test/timming.hpp index f92e1bc737..c9e8f44829 100644 --- a/test/timming.hpp +++ b/test/timming.hpp @@ -14,7 +14,7 @@ #define BOOST_THREAD_TEST_TIME_MS 75 #else // Windows, Cygwin, macOS all need this -#define BOOST_THREAD_TEST_TIME_MS 400 +#define BOOST_THREAD_TEST_TIME_MS 600 #endif #endif From 171eb5811e839f24553d2733fad467b5ba9b4e04 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 3 Jul 2026 14:16:17 +0300 Subject: [PATCH 73/80] Enable OpenMP on gcc for test_9856. By default, OpenMP is not enabled in gcc, which means the test is run sequentially and compiler warnings about an unsupported #pragma. Enable OpenMP for gcc and this particular test. --- test/Jamfile.v2 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 340f6c0aa7..511977a03f 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -110,18 +110,18 @@ project msvc:/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/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/static - : : : + : : : $(reqs) : $(name)_lib ] ; } @@ -362,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 : + gcc:-fopenmp + gcc:-fopenmp + ] [ thread-compile test_10963.cpp : : test_10963_c ] [ thread-run test_10964.cpp ] [ thread-test test_11053.cpp ] From 65410ba73929bc312459da7b3ab728a84ee619d2 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 3 Jul 2026 19:16:57 +0300 Subject: [PATCH 74/80] Reduced OMP thread count to avoid test failures due to resource exhaustion. --- test/test_9856.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_9856.cpp b/test/test_9856.cpp index b7dcc6e37d..cd8c424342 100644 --- a/test/test_9856.cpp +++ b/test/test_9856.cpp @@ -7,7 +7,7 @@ using namespace boost; int main() { atomic total(0), failures(0); -#pragma omp parallel shared(total, failures) num_threads(1000) +#pragma omp parallel shared(total, failures) num_threads(16) { mutex mtx; condition_variable cond; From 6fdc4aa10db356a2a78de0ed9b527f4755eb7c4d Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 3 Jul 2026 14:32:30 +0300 Subject: [PATCH 75/80] Fix mutex assignment tests to actually test that assignment is prohibited. Previously, mutex assignment tests were copies of the copy constructor tests and did not verify that the assignment operator was deleted. Fix this. --- test/sync/mutual_exclusion/mutex/assign_fail.cpp | 4 +++- test/sync/mutual_exclusion/null_mutex/assign_fail.cpp | 4 +++- test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp | 4 +++- test/sync/mutual_exclusion/shared_mutex/assign_fail.cpp | 4 +++- test/sync/mutual_exclusion/timed_mutex/assign_fail.cpp | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/test/sync/mutual_exclusion/mutex/assign_fail.cpp b/test/sync/mutual_exclusion/mutex/assign_fail.cpp index 5e4827bf51..30508dbf29 100644 --- a/test/sync/mutual_exclusion/mutex/assign_fail.cpp +++ b/test/sync/mutual_exclusion/mutex/assign_fail.cpp @@ -24,7 +24,9 @@ int main() { boost::mutex m0; - boost::mutex m1(m0); + boost::mutex m1; + m1 = m0; + (void)m1; } #include "../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/null_mutex/assign_fail.cpp b/test/sync/mutual_exclusion/null_mutex/assign_fail.cpp index 64a74e42db..4d45feff85 100644 --- a/test/sync/mutual_exclusion/null_mutex/assign_fail.cpp +++ b/test/sync/mutual_exclusion/null_mutex/assign_fail.cpp @@ -24,7 +24,9 @@ int main() { boost::null_mutex m0; - boost::null_mutex m1(m0); + boost::null_mutex m1; + m1 = m0; + (void)m1; } #include "../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp b/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp index e3bbd68273..ab1a1a444b 100644 --- a/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp +++ b/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp @@ -24,7 +24,9 @@ int main() { boost::recursive_mutex m0; - boost::recursive_mutex m1(m0); + boost::recursive_mutex m1; + m1 = m0; + (void)m1; } #include "../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/shared_mutex/assign_fail.cpp b/test/sync/mutual_exclusion/shared_mutex/assign_fail.cpp index e67795e030..db5b729182 100644 --- a/test/sync/mutual_exclusion/shared_mutex/assign_fail.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/assign_fail.cpp @@ -24,7 +24,9 @@ int main() { boost::shared_mutex m0; - boost::shared_mutex m1(m0); + boost::shared_mutex m1; + m1 = m0; + (void)m1; } #include "../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/timed_mutex/assign_fail.cpp b/test/sync/mutual_exclusion/timed_mutex/assign_fail.cpp index 4b9972155c..b929007375 100644 --- a/test/sync/mutual_exclusion/timed_mutex/assign_fail.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/assign_fail.cpp @@ -24,7 +24,9 @@ int main() { boost::timed_mutex m0; - boost::timed_mutex m1(m0); + boost::timed_mutex m1; + m1 = m0; + (void)m1; } #include "../../../remove_error_code_unused_warning.hpp" From aeabeffe4dd473cba263f53bbc926cb20ca17bbf Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 3 Jul 2026 14:34:54 +0300 Subject: [PATCH 76/80] Silence compiler warnings about unused variables. --- .../sync/conditions/condition_variable/wait_for_pred_pass.cpp | 2 ++ .../conditions/condition_variable/wait_until_pred_pass.cpp | 1 + .../mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp | 1 + .../sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp | 1 + .../locks/nested_strict_lock/copy_assign_fail.cpp | 2 +- .../locks/nested_strict_lock/copy_ctor_fail.cpp | 1 + .../mutual_exclusion/locks/reverse_lock/copy_assign_fail.cpp | 2 +- .../mutual_exclusion/locks/reverse_lock/copy_ctor_fail.cpp | 1 + .../locks/shared_lock_guard/copy_assign_fail.cpp | 1 + .../locks/shared_lock_guard/copy_ctor_fail.cpp | 1 + .../mutual_exclusion/locks/strict_lock/copy_assign_fail.cpp | 1 + .../mutual_exclusion/locks/strict_lock/copy_ctor_fail.cpp | 1 + test/sync/mutual_exclusion/mutex/copy_fail.cpp | 1 + test/sync/mutual_exclusion/mutex/default_pass.cpp | 1 + test/sync/mutual_exclusion/null_mutex/copy_fail.cpp | 1 + test/sync/mutual_exclusion/null_mutex/default_pass.cpp | 1 + test/sync/mutual_exclusion/recursive_mutex/copy_fail.cpp | 1 + test/sync/mutual_exclusion/recursive_mutex/default_pass.cpp | 1 + .../mutual_exclusion/recursive_timed_mutex/assign_fail.cpp | 4 +++- .../sync/mutual_exclusion/recursive_timed_mutex/copy_fail.cpp | 1 + .../mutual_exclusion/recursive_timed_mutex/default_pass.cpp | 1 + test/sync/mutual_exclusion/shared_mutex/copy_fail.cpp | 1 + test/sync/mutual_exclusion/shared_mutex/default_pass.cpp | 1 + .../mutual_exclusion/synchronized_value/default_ctor_pass.cpp | 2 ++ test/sync/mutual_exclusion/timed_mutex/copy_fail.cpp | 1 + test/sync/mutual_exclusion/timed_mutex/default_pass.cpp | 1 + 26 files changed, 30 insertions(+), 3 deletions(-) diff --git a/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp b/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp index d05cf76566..cf2bcfd5f7 100644 --- a/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp +++ b/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp @@ -68,6 +68,8 @@ void f() BOOST_ATTRIBUTE_UNUSED Clock::time_point t0 = Clock::now(); cv.wait_for(lk, milliseconds(250), Pred(test2)); BOOST_ATTRIBUTE_UNUSED Clock::time_point t1 = Clock::now(); + (void)t0; + (void)t1; if (runs == 0) { assert(t1 - t0 < max_diff); diff --git a/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp b/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp index a0eee6a679..dd1c540c50 100644 --- a/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp +++ b/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp @@ -82,6 +82,7 @@ void f() Clock::time_point t = t0 + Clock::duration(250); 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); diff --git a/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp index b3e20f341c..092d167cc6 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp @@ -30,6 +30,7 @@ int main() boost::lock_guard lk0(g_mutex0); boost::lock_guard lk1(g_mutex1); lk1 = lk0; + (void)lk1; } #include "../../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp index c492c28ddb..8b725c19a3 100644 --- a/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp @@ -29,6 +29,7 @@ int main() { boost::lock_guard lk0(g_mutex0); boost::lock_guard lk1 = lk0; + (void)lk1; } #include "../../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_assign_fail.cpp index 01f279d632..9cab6dddbb 100644 --- a/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_assign_fail.cpp @@ -24,7 +24,7 @@ int main() boost::nested_strict_lock > nlk0(lk0); boost::nested_strict_lock > nlk1(lk1); lk1 = lk0; - + (void)lk1; } #include "../../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_ctor_fail.cpp index 01a626f722..0b6d3d2620 100644 --- a/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/nested_strict_lock/copy_ctor_fail.cpp @@ -21,6 +21,7 @@ int main() { boost::nested_strict_lock > lk0(g_mutex0); boost::nested_strict_lock > lk1 = lk0; + (void)lk1; } #include "../../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/locks/reverse_lock/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/reverse_lock/copy_assign_fail.cpp index 408e0f2672..42bd7cb98d 100644 --- a/test/sync/mutual_exclusion/locks/reverse_lock/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/reverse_lock/copy_assign_fail.cpp @@ -25,8 +25,8 @@ int main() boost::reverse_lock > lg0(lk0); boost::reverse_lock > lg1(lk1); lg1 = lg0; + (void)lg1; } - } #include "../../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/locks/reverse_lock/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/reverse_lock/copy_ctor_fail.cpp index 7a9c76a932..64ae7d70c5 100644 --- a/test/sync/mutual_exclusion/locks/reverse_lock/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/reverse_lock/copy_ctor_fail.cpp @@ -22,6 +22,7 @@ int main() { boost::reverse_lock > lg0(lk0); boost::reverse_lock > lg1(lg0); + (void)lg1; } } diff --git a/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp index e61c82e7b7..d22c8a51a4 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp @@ -30,6 +30,7 @@ int main() boost::shared_lock_guard lk0(g_mutex0); boost::shared_lock_guard lk1(g_mutex1); lk1 = lk0; + (void)lk1; } #include "../../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp index 7a98d7103e..b4bb6db958 100644 --- a/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp @@ -29,6 +29,7 @@ int main() { boost::shared_lock_guard lk0(g_mutex0); boost::shared_lock_guard lk1 = lk0; + (void)lk1; } #include "../../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/locks/strict_lock/copy_assign_fail.cpp b/test/sync/mutual_exclusion/locks/strict_lock/copy_assign_fail.cpp index 4f79f107e5..b4aac197b9 100644 --- a/test/sync/mutual_exclusion/locks/strict_lock/copy_assign_fail.cpp +++ b/test/sync/mutual_exclusion/locks/strict_lock/copy_assign_fail.cpp @@ -21,6 +21,7 @@ int main() boost::strict_lock lk0(g_mutex0); boost::strict_lock lk1(g_mutex1); lk1 = lk0; + (void)lk1; } #include "../../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/locks/strict_lock/copy_ctor_fail.cpp b/test/sync/mutual_exclusion/locks/strict_lock/copy_ctor_fail.cpp index 27361e3616..77ecb21282 100644 --- a/test/sync/mutual_exclusion/locks/strict_lock/copy_ctor_fail.cpp +++ b/test/sync/mutual_exclusion/locks/strict_lock/copy_ctor_fail.cpp @@ -20,6 +20,7 @@ int main() { boost::strict_lock lk0(g_mutex0); boost::strict_lock lk1 = lk0; + (void)lk1; } #include "../../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/mutex/copy_fail.cpp b/test/sync/mutual_exclusion/mutex/copy_fail.cpp index 3a091cd90c..d6b1d4321f 100644 --- a/test/sync/mutual_exclusion/mutex/copy_fail.cpp +++ b/test/sync/mutual_exclusion/mutex/copy_fail.cpp @@ -25,6 +25,7 @@ int main() { boost::mutex m0; boost::mutex m1(m0); + (void)m1; } #include "../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/mutex/default_pass.cpp b/test/sync/mutual_exclusion/mutex/default_pass.cpp index a55dfcd9bc..65846c1ae3 100644 --- a/test/sync/mutual_exclusion/mutex/default_pass.cpp +++ b/test/sync/mutual_exclusion/mutex/default_pass.cpp @@ -24,6 +24,7 @@ int main() { boost::mutex m0; + (void)m0; return boost::report_errors(); } diff --git a/test/sync/mutual_exclusion/null_mutex/copy_fail.cpp b/test/sync/mutual_exclusion/null_mutex/copy_fail.cpp index 80e7cca92e..0d22b5a1fb 100644 --- a/test/sync/mutual_exclusion/null_mutex/copy_fail.cpp +++ b/test/sync/mutual_exclusion/null_mutex/copy_fail.cpp @@ -25,6 +25,7 @@ int main() { boost::null_mutex m0; boost::null_mutex m1(m0); + (void)m1; } #include "../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/null_mutex/default_pass.cpp b/test/sync/mutual_exclusion/null_mutex/default_pass.cpp index eb2f620e77..c3a4bd780d 100644 --- a/test/sync/mutual_exclusion/null_mutex/default_pass.cpp +++ b/test/sync/mutual_exclusion/null_mutex/default_pass.cpp @@ -24,6 +24,7 @@ int main() { boost::null_mutex m0; + (void)m0; return boost::report_errors(); } diff --git a/test/sync/mutual_exclusion/recursive_mutex/copy_fail.cpp b/test/sync/mutual_exclusion/recursive_mutex/copy_fail.cpp index f12a21dc5e..d3db4b966f 100644 --- a/test/sync/mutual_exclusion/recursive_mutex/copy_fail.cpp +++ b/test/sync/mutual_exclusion/recursive_mutex/copy_fail.cpp @@ -25,6 +25,7 @@ int main() { boost::recursive_mutex m0; boost::recursive_mutex m1(m0); + (void)m1; } #include "../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/recursive_mutex/default_pass.cpp b/test/sync/mutual_exclusion/recursive_mutex/default_pass.cpp index b0d3b81e76..497fb63d37 100644 --- a/test/sync/mutual_exclusion/recursive_mutex/default_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_mutex/default_pass.cpp @@ -24,6 +24,7 @@ int main() { boost::recursive_mutex m0; + (void)m0; return boost::report_errors(); } diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/assign_fail.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/assign_fail.cpp index f6e215a303..f3b03bda76 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/assign_fail.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/assign_fail.cpp @@ -24,7 +24,9 @@ int main() { boost::recursive_timed_mutex m0; - boost::recursive_timed_mutex m1(m0); + boost::recursive_timed_mutex m1; + m1 = m0; + (void)m1; } #include "../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/copy_fail.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/copy_fail.cpp index 62a4e9c9de..bf6e75992b 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/copy_fail.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/copy_fail.cpp @@ -25,6 +25,7 @@ int main() { boost::recursive_timed_mutex m0; boost::recursive_timed_mutex m1(m0); + (void)m1; } #include "../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/default_pass.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/default_pass.cpp index ef6107ee0d..88f82ee85a 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/default_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/default_pass.cpp @@ -24,6 +24,7 @@ int main() { boost::recursive_timed_mutex m0; + (void)m0; return boost::report_errors(); } diff --git a/test/sync/mutual_exclusion/shared_mutex/copy_fail.cpp b/test/sync/mutual_exclusion/shared_mutex/copy_fail.cpp index 280546d90f..5d058faf2e 100644 --- a/test/sync/mutual_exclusion/shared_mutex/copy_fail.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/copy_fail.cpp @@ -25,6 +25,7 @@ int main() { boost::shared_mutex m0; boost::shared_mutex m1(m0); + (void)m1; } #include "../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/shared_mutex/default_pass.cpp b/test/sync/mutual_exclusion/shared_mutex/default_pass.cpp index a0bbaccfd0..2e1ec16c5c 100644 --- a/test/sync/mutual_exclusion/shared_mutex/default_pass.cpp +++ b/test/sync/mutual_exclusion/shared_mutex/default_pass.cpp @@ -24,6 +24,7 @@ int main() { boost::shared_mutex m0; + (void)m0; return boost::report_errors(); } diff --git a/test/sync/mutual_exclusion/synchronized_value/default_ctor_pass.cpp b/test/sync/mutual_exclusion/synchronized_value/default_ctor_pass.cpp index 3ceb5455ce..3bc44dbe27 100644 --- a/test/sync/mutual_exclusion/synchronized_value/default_ctor_pass.cpp +++ b/test/sync/mutual_exclusion/synchronized_value/default_ctor_pass.cpp @@ -20,9 +20,11 @@ int main() { boost::synchronized_value f; + (void)f; } { boost::synchronized_value f; + (void)f; } return boost::report_errors(); diff --git a/test/sync/mutual_exclusion/timed_mutex/copy_fail.cpp b/test/sync/mutual_exclusion/timed_mutex/copy_fail.cpp index 3977196e69..cb3daf6398 100644 --- a/test/sync/mutual_exclusion/timed_mutex/copy_fail.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/copy_fail.cpp @@ -25,6 +25,7 @@ int main() { boost::timed_mutex m0; boost::timed_mutex m1(m0); + (void)m1; } #include "../../../remove_error_code_unused_warning.hpp" diff --git a/test/sync/mutual_exclusion/timed_mutex/default_pass.cpp b/test/sync/mutual_exclusion/timed_mutex/default_pass.cpp index c5ac77d9db..85362cca5f 100644 --- a/test/sync/mutual_exclusion/timed_mutex/default_pass.cpp +++ b/test/sync/mutual_exclusion/timed_mutex/default_pass.cpp @@ -24,6 +24,7 @@ int main() { boost::timed_mutex m0; + (void)m0; return boost::report_errors(); } From 0bdc465f89418626d22326781988e994a8fe2cce Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 3 Jul 2026 14:52:05 +0300 Subject: [PATCH 77/80] Fix uninitialized variable warnings in sync queue tests. --- .../sync_bounded_queue/single_thread_pass.cpp | 30 +++++++++---------- .../sync_deque/single_thread_pass.cpp | 17 +++++------ .../sync_pq/pq_single_thread_pass.cpp | 20 ++++++------- .../sync_pq/tq_multi_thread_pass.cpp | 6 ++-- .../sync_pq/tq_single_thread_pass.cpp | 4 +-- .../sync_queue/single_thread_pass.cpp | 14 ++++----- 6 files changed, 45 insertions(+), 46 deletions(-) diff --git a/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp index 6dd6d20093..ba868e7f0f 100644 --- a/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_bounded_queue/single_thread_pass.cpp @@ -162,7 +162,7 @@ int main() // 1-element queue pull succeed boost::sync_bounded_queue q(2); q.push(1); - int i; + int i = -1; q.pull(i); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -198,7 +198,7 @@ int main() // 1-element queue try_pull succeed boost::sync_bounded_queue q(2); q.push(1); - int i; + int i = -1; BOOST_TEST(q.try_pull(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -210,7 +210,7 @@ int main() // 1-element queue try_pull succeed boost::sync_bounded_queue q(2); q.push(1); - int i; + int i = -1; BOOST_TEST(q.try_pull(boost::no_block, i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -280,7 +280,7 @@ int main() boost::sync_bounded_queue q(2); q.push(1); q.close(); - int i; + int i = -1; q.pull(i); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -292,7 +292,7 @@ int main() { // empty queue try_pull fails boost::sync_bounded_queue q(2); - int i; + int i = -1; BOOST_TEST( boost::queue_op_status::empty == q.try_pull_front(i)); BOOST_TEST(q.empty()); BOOST_TEST(! q.full()); @@ -422,7 +422,7 @@ int main() // 1-element queue pull succeed boost::sync_bounded_queue q(2); q.push_back(1); - int i; + int i = -1; q.pull_front(i); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -458,7 +458,7 @@ int main() // 1-element queue try_pull succeed boost::sync_bounded_queue q(2); q.push_back(1); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.try_pull_front(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -470,7 +470,7 @@ int main() // 1-element queue nonblocking_pull_front succeed boost::sync_bounded_queue q(2); q.push_back(1); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.nonblocking_pull_front(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -482,7 +482,7 @@ int main() // 1-element queue wait_pull_front succeed boost::sync_bounded_queue q(2); q.push_back(1); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.wait_pull_front(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -529,7 +529,7 @@ int main() // closed empty queue try_pull_front closed boost::sync_bounded_queue q(2); q.close(); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::closed == q.try_pull_front(i)); BOOST_TEST(q.empty()); BOOST_TEST(! q.full()); @@ -540,7 +540,7 @@ int main() // closed empty queue nonblocking_pull_front closed boost::sync_bounded_queue q(2); q.close(); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::closed == q.nonblocking_pull_front(i)); BOOST_TEST(q.empty()); BOOST_TEST(! q.full()); @@ -552,7 +552,7 @@ int main() boost::sync_bounded_queue q(2); q.push_back(1); q.close(); - int i; + int i = -1; q.pull_front(i); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -565,7 +565,7 @@ int main() boost::sync_bounded_queue q(2); q.push_back(1); q.close(); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.wait_pull_front(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -579,7 +579,7 @@ int main() q.close(); BOOST_TEST(q.empty()); BOOST_TEST(q.closed()); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::closed == q.wait_pull_front(i)); BOOST_TEST(q.empty()); BOOST_TEST(q.closed()); @@ -595,6 +595,6 @@ int main() BOOST_TEST(q.empty()); BOOST_TEST(q.closed()); } + return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/sync_deque/single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_deque/single_thread_pass.cpp index dd3852925b..93545c632b 100644 --- a/test/sync/mutual_exclusion/sync_deque/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_deque/single_thread_pass.cpp @@ -49,7 +49,7 @@ int main() { // empty queue try_pull fails boost::sync_deque q; - int i; + int i = -1; BOOST_TEST( boost::queue_op_status::empty == q.try_pull_front(i)); BOOST_TEST(q.empty()); BOOST_TEST(! q.full()); @@ -204,7 +204,7 @@ int main() // 1-element queue pull_front succeed boost::sync_deque q; q.push_back(1); - int i; + int i = -1; q.pull_front(i); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -252,7 +252,7 @@ int main() // 1-element queue try_pull_front succeed boost::sync_deque q; q.push_back(1); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.try_pull_front(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -277,7 +277,7 @@ int main() // 1-element queue nonblocking_pull_front succeed boost::sync_deque q; q.push_back(1); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.nonblocking_pull_front(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -315,7 +315,7 @@ int main() // 1-element queue wait_pull_front succeed boost::sync_deque q; q.push_back(1); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.wait_pull_front(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -365,7 +365,7 @@ int main() boost::sync_deque q; q.push_back(1); q.close(); - int i; + int i = -1; q.pull_front(i); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -378,7 +378,7 @@ int main() boost::sync_deque q; q.push_back(1); q.close(); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.wait_pull_front(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -392,7 +392,7 @@ int main() q.close(); BOOST_TEST(q.empty()); BOOST_TEST(q.closed()); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::closed == q.wait_pull_front(i)); BOOST_TEST(q.empty()); BOOST_TEST(q.closed()); @@ -400,4 +400,3 @@ int main() return boost::report_errors(); } - diff --git a/test/sync/mutual_exclusion/sync_pq/pq_single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_pq/pq_single_thread_pass.cpp index d705df8eb6..ebb612c2a7 100644 --- a/test/sync/mutual_exclusion/sync_pq/pq_single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_pq/pq_single_thread_pass.cpp @@ -55,7 +55,7 @@ void test_pull_for() { sync_pq pq; steady_clock::time_point start = steady_clock::now(); - int val; + int val = -1; boost::queue_op_status st = pq.pull_for(milliseconds(500), val); ns d = steady_clock::now() - start - milliseconds(500); BOOST_THREAD_TEST_IT(d, ns(max_diff)); @@ -66,7 +66,7 @@ void test_pull_until() { sync_pq pq; steady_clock::time_point start = steady_clock::now(); - int val; + int val = -1; boost::queue_op_status st = pq.pull_until(start + milliseconds(500), val); ns d = steady_clock::now() - start - milliseconds(500); BOOST_THREAD_TEST_IT(d, ns(max_diff)); @@ -77,7 +77,7 @@ void test_nonblocking_pull() { sync_pq pq; steady_clock::time_point start = steady_clock::now(); - int val; + int val = -1; boost::queue_op_status st = pq.nonblocking_pull(val); ns d = steady_clock::now() - start; BOOST_THREAD_TEST_IT(d, ns(max_diff)); @@ -89,7 +89,7 @@ void test_pull_for_when_not_empty() sync_pq pq; pq.push(1); steady_clock::time_point start = steady_clock::now(); - int val; + int val = -1; boost::queue_op_status st = pq.pull_for(milliseconds(500), val); ns d = steady_clock::now() - start; BOOST_THREAD_TEST_IT(d, ns(max_diff)); @@ -102,7 +102,7 @@ void test_pull_until_when_not_empty() sync_pq pq; pq.push(1); steady_clock::time_point start = steady_clock::now(); - int val; + int val = -1; boost::queue_op_status st = pq.pull_until(start + milliseconds(500), val); ns d = steady_clock::now() - start; BOOST_THREAD_TEST_IT(d, ns(max_diff)); @@ -274,7 +274,7 @@ int main() // 1-element queue try_pull succeed boost::concurrent::sync_priority_queue q; q.push(1); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.try_pull(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -301,7 +301,7 @@ int main() // 1-element queue nonblocking_pull succeed boost::concurrent::sync_priority_queue q; q.push(1); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.nonblocking_pull(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -341,7 +341,7 @@ int main() // 1-element queue wait_pull succeed boost::concurrent::sync_priority_queue q; q.push(1); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.wait_pull(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -406,7 +406,7 @@ int main() boost::concurrent::sync_priority_queue q; q.push(1); q.close(); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.wait_pull(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -420,7 +420,7 @@ int main() q.close(); BOOST_TEST(q.empty()); BOOST_TEST(q.closed()); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::closed == q.wait_pull(i)); BOOST_TEST(q.empty()); BOOST_TEST(q.closed()); diff --git a/test/sync/mutual_exclusion/sync_pq/tq_multi_thread_pass.cpp b/test/sync/mutual_exclusion/sync_pq/tq_multi_thread_pass.cpp index 17ee30f30b..b28c3ab213 100644 --- a/test/sync/mutual_exclusion/sync_pq/tq_multi_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_pq/tq_multi_thread_pass.cpp @@ -43,7 +43,7 @@ void call_pull(sync_tq* q, const steady_clock::time_point start) // pull elements off of the queue (earliest element first) for (int i = cnt - 1; i >= 0; --i) { - int j; + int j = -1; q->pull(j); BOOST_TEST_EQ(i, j); const steady_clock::time_point expected = start + milliseconds(i * 500) + seconds(cnt - i); @@ -57,7 +57,7 @@ void call_pull_until(sync_tq* q, const steady_clock::time_point start) // pull elements off of the queue (earliest element first) for (int i = cnt - 1; i >= 0; --i) { - int j; + int j = -1; q->pull_until(steady_clock::now() + hours(1), j); BOOST_TEST_EQ(i, j); const steady_clock::time_point expected = start + milliseconds(i * 500) + seconds(cnt - i); @@ -71,7 +71,7 @@ void call_pull_for(sync_tq* q, const steady_clock::time_point start) // pull elements off of the queue (earliest element first) for (int i = cnt - 1; i >= 0; --i) { - int j; + int j = -1; q->pull_for(hours(1), j); BOOST_TEST_EQ(i, j); const steady_clock::time_point expected = start + milliseconds(i * 500) + seconds(cnt - i); diff --git a/test/sync/mutual_exclusion/sync_pq/tq_single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_pq/tq_single_thread_pass.cpp index 13fb84d3ac..c95654d662 100644 --- a/test/sync/mutual_exclusion/sync_pq/tq_single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_pq/tq_single_thread_pass.cpp @@ -50,7 +50,7 @@ void test_all() BOOST_TEST_EQ(val, i); } - int val; + int val = -1; boost::queue_op_status st = pq.nonblocking_pull(val); BOOST_TEST(boost::queue_op_status::empty == st); @@ -87,7 +87,7 @@ void test_all_with_try() BOOST_TEST_EQ(val, i); } - int val; + int val = -1; boost::queue_op_status st = pq.nonblocking_pull(val); BOOST_TEST(st == boost::queue_op_status::empty ); diff --git a/test/sync/mutual_exclusion/sync_queue/single_thread_pass.cpp b/test/sync/mutual_exclusion/sync_queue/single_thread_pass.cpp index da9b346fd3..382722edb2 100644 --- a/test/sync/mutual_exclusion/sync_queue/single_thread_pass.cpp +++ b/test/sync/mutual_exclusion/sync_queue/single_thread_pass.cpp @@ -175,7 +175,7 @@ int main() // 1-element queue pull succeed boost::sync_queue q; q.push(1); - int i; + int i = -1; q.pull(i); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -223,7 +223,7 @@ int main() // 1-element queue try_pull succeed boost::sync_queue q; q.push(1); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.try_pull(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -248,7 +248,7 @@ int main() // 1-element queue nonblocking_pull succeed boost::sync_queue q; q.push(1); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.nonblocking_pull(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -286,7 +286,7 @@ int main() // 1-element queue wait_pull succeed boost::sync_queue q; q.push(1); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.wait_pull(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -336,7 +336,7 @@ int main() boost::sync_queue q; q.push(1); q.close(); - int i; + int i = -1; q.pull(i); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -349,7 +349,7 @@ int main() boost::sync_queue q; q.push(1); q.close(); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::success == q.wait_pull(i)); BOOST_TEST_EQ(i, 1); BOOST_TEST(q.empty()); @@ -363,7 +363,7 @@ int main() q.close(); BOOST_TEST(q.empty()); BOOST_TEST(q.closed()); - int i; + int i = -1; BOOST_TEST(boost::queue_op_status::closed == q.wait_pull(i)); BOOST_TEST(q.empty()); BOOST_TEST(q.closed()); From c28c5a4b283700f4966e1c60d0992eff901c0f53 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 3 Jul 2026 15:13:30 +0300 Subject: [PATCH 78/80] Try to gracefully finish the timed_join test in case of timeout. --- test/test_thread.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_thread.cpp b/test/test_thread.cpp index b23a57f7f0..c3b042a581 100644 --- a/test/test_thread.cpp +++ b/test/test_thread.cpp @@ -197,6 +197,12 @@ void do_test_timed_join() BOOST_CHECK(xt>now); BOOST_CHECK(joined2); BOOST_CHECK(!thrd.joinable()); + if (thrd.joinable()) + { + // Try to finish the failed test gracefully + thrd.interrupt(); + thrd.join(); + } } BOOST_AUTO_TEST_CASE(test_timed_join) From 3f285e56005a8e37fdc929b4cc58fa21187e3f38 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 3 Jul 2026 16:33:12 +0300 Subject: [PATCH 79/80] Fixed more MSVC warnings about variables shadowing other variables. --- example/make_future.cpp | 16 ++++---- example/mutex.cpp | 8 ++-- example/once.cpp | 16 ++++---- example/recursive_mutex.cpp | 4 +- example/tennis.cpp | 40 +++++++++---------- example/thread_group.cpp | 23 +++++------ example/tss.cpp | 8 ++-- example/with_lock_guard.cpp | 16 ++++---- .../try_lock_for_pass.cpp | 6 +-- .../container/thread_ptr_list_pass.cpp | 10 ++--- 10 files changed, 73 insertions(+), 74 deletions(-) diff --git a/example/make_future.cpp b/example/make_future.cpp index 76207d7ad8..2fd53f9628 100644 --- a/example/make_future.cpp +++ b/example/make_future.cpp @@ -112,21 +112,21 @@ int main() #if __cplusplus > 201103L { std::cout << __FILE__ << " "<< __LINE__ << std::endl; - int i = 0; - boost::future f = boost::make_ready_future(std::ref(i)); + int x = 0; + boost::future 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 f = boost::make_ready_future(boost::ref(i)); + int x = 0; + boost::future 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 f = boost::make_ready_future(boost::cref(i)); + const int x = 0; + boost::future 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 "< #include -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 @@ class counter int count; }; -counter c; +counter g_counter; void change_count() { - int i = c.increment(); - boost::unique_lock scoped_lock(io_mutex); + int i = g_counter.increment(); + boost::unique_lock scoped_lock(g_io_mutex); std::cout << "count == " << i << std::endl; } diff --git a/example/once.cpp b/example/once.cpp index c063a9ce45..d248ad8502 100644 --- a/example/once.cpp +++ b/example/once.cpp @@ -10,23 +10,23 @@ #include #include -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); } diff --git a/example/recursive_mutex.cpp b/example/recursive_mutex.cpp index 8cb99d30d3..5ef259b0e6 100644 --- a/example/recursive_mutex.cpp +++ b/example/recursive_mutex.cpp @@ -28,11 +28,11 @@ class counter 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*[]) diff --git a/example/tennis.cpp b/example/tennis.cpp index d560ecb920..6a1a83ec22 100644 --- a/example/tennis.cpp +++ b/example/tennis.cpp @@ -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 lock(mutex); + boost::unique_lock 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 @@ class thread_adapter 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 lock(mutex); + boost::unique_lock 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 lock(mutex); + boost::unique_lock 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; diff --git a/example/thread_group.cpp b/example/thread_group.cpp index 1256a1045b..56a693a123 100644 --- a/example/thread_group.cpp +++ b/example/thread_group.cpp @@ -8,23 +8,22 @@ #include #include -int count = 0; -boost::mutex mutex; +int g_count = 0; +boost::mutex g_mutex; void increment_count() { - boost::unique_lock lock(mutex); - std::cout << "count = " << ++count << std::endl; + boost::unique_lock 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 lock(mutex); - BOOST_TEST(threads2.is_this_thread_in()); - std::cout << "count = " << ++count << std::endl; + boost::unique_lock 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 lock(mutex); + boost::unique_lock 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(); } diff --git a/example/tss.cpp b/example/tss.cpp index f5f108e114..fdab19a519 100644 --- a/example/tss.cpp +++ b/example/tss.cpp @@ -8,21 +8,21 @@ #include #include -boost::thread_specific_ptr value; +boost::thread_specific_ptr 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); } diff --git a/example/with_lock_guard.cpp b/example/with_lock_guard.cpp index f3a4cd8064..a98f5d3475 100644 --- a/example/with_lock_guard.cpp +++ b/example/with_lock_guard.cpp @@ -12,18 +12,18 @@ #include #include -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)); diff --git a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp index 73b6aa4c0b..87b16a8521 100644 --- a/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp +++ b/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp @@ -50,10 +50,10 @@ void f1() void f2() { - time_point g_t0 = Clock::now(); + time_point t0 = Clock::now(); BOOST_TEST(g_mutex.try_lock_for(ms(250)) == false); - time_point g_t1 = Clock::now(); - ns d = g_t1 - g_t0 - ms(250); + time_point t1 = Clock::now(); + ns d = t1 - t0 - ms(250); BOOST_THREAD_TEST_IT(d, ns(max_diff)); } diff --git a/test/threads/container/thread_ptr_list_pass.cpp b/test/threads/container/thread_ptr_list_pass.cpp index 2727d036f7..3a224ab6fd 100644 --- a/test/threads/container/thread_ptr_list_pass.cpp +++ b/test/threads/container/thread_ptr_list_pass.cpp @@ -15,8 +15,8 @@ #include -int count = 0; -boost::mutex mutex; +int g_count = 0; +boost::mutex g_mutex; namespace { @@ -33,8 +33,8 @@ void join_all(TC & tc) void increment_count() { - boost::unique_lock lock(mutex); - std::cout << "count = " << ++count << std::endl; + boost::unique_lock lock(g_mutex); + std::cout << "count = " << ++g_count << std::endl; } template @@ -72,7 +72,7 @@ int main() (*it)->join(); } } - count = 0; + g_count = 0; { typedef boost::shared_ptr thread_ptr; //typedef boost::interprocess::shared_ptr, default_delete > thread_ptr; From 608459ab7c50092f6d91dbbe48caf349ec16ed3b Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 3 Jul 2026 21:57:51 +0300 Subject: [PATCH 80/80] Increased BOOST_THREAD_TEST_TIME_MS yet more because of test failures on Windows. --- test/timming.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/timming.hpp b/test/timming.hpp index c9e8f44829..b83642da2c 100644 --- a/test/timming.hpp +++ b/test/timming.hpp @@ -14,7 +14,7 @@ #define BOOST_THREAD_TEST_TIME_MS 75 #else // Windows, Cygwin, macOS all need this -#define BOOST_THREAD_TEST_TIME_MS 600 +#define BOOST_THREAD_TEST_TIME_MS 700 #endif #endif