Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78543 - in branches/release: boost boost/detail boost/thread boost/thread/detail boost/thread/pthread boost/thread/v2 boost/thread/win32 libs/thread libs/thread/build libs/thread/doc libs/thread/example libs/thread/src libs/thread/src/pthread libs/thread/src/win32 libs/thread/test libs/thread/test/sync libs/thread/test/sync/conditions libs/thread/test/sync/conditions/condition_variable libs/thread/test/sync/conditions/condition_variable_any libs/thread/test/sync/conditions/cv_status libs/thread/test/sync/futures libs/thread/test/sync/futures/async libs/thread/test/sync/futures/errors libs/thread/test/sync/futures/future libs/thread/test/sync/futures/future_errc libs/thread/test/sync/futures/future_errors libs/thread/test/sync/futures/future_status libs/thread/test/sync/futures/packaged_task libs/thread/test/sync/futures/promise libs/thread/test/sync/futures/shared_future libs/thread/test/sync/mutual_exclusion libs/thread/test/sync/mutual_exclusion/barrier libs/thread/test/sync/mutual_exclusion/lock_algorithm libs/thread/test/sync/mutual_exclusion/lock_algorithm/lock libs/thread/test/sync/mutual_exclusion/lock_algorithm/try_lock libs/thread/test/sync/mutual_exclusion/locks libs/thread/test/sync/mutual_exclusion/locks/lock_guard libs/thread/test/sync/mutual_exclusion/locks/reverse_lock libs/thread/test/sync/mutual_exclusion/locks/shared_lock libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons libs/thread/test/sync/mutual_exclusion/locks/shared_lock/locking libs/thread/test/sync/mutual_exclusion/locks/shared_lock/mod libs/thread/test/sync/mutual_exclusion/locks/shared_lock/obs libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard libs/thread/test/sync/mutual_exclusion/locks/unique_lock libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons libs/thread/test/sync/mutual_exclusion/locks/unique_lock/locking libs/thread/test/sync/mutual_exclusion/locks/unique_lock/mod libs/thread/test/sync/mutual_exclusion/locks/unique_lock/obs libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/locking libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/mod libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/obs libs/thread/test/sync/mutual_exclusion/locks/upgrade_to_unique_lock libs/thread/test/sync/mutual_exclusion/mutex libs/thread/test/sync/mutual_exclusion/once libs/thread/test/sync/mutual_exclusion/once/call_once libs/thread/test/sync/mutual_exclusion/once/once_flag libs/thread/test/sync/mutual_exclusion/recursive_mutex libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex libs/thread/test/sync/mutual_exclusion/shared_mutex libs/thread/test/sync/mutual_exclusion/timed_mutex libs/thread/test/threads libs/thread/test/threads/container libs/thread/test/threads/this_thread libs/thread/test/threads/this_thread/at_thread_exit libs/thread/test/threads/this_thread/disable_interruption libs/thread/test/threads/this_thread/get_id libs/thread/test/threads/this_thread/interruption_enabled libs/thread/test/threads/this_thread/interruption_point libs/thread/test/threads/this_thread/interruption_requested libs/thread/test/threads/this_thread/restore_interruption libs/thread/test/threads/this_thread/sleep_for libs/thread/test/threads/this_thread/sleep_until libs/thread/test/threads/this_thread/yield libs/thread/test/threads/thread libs/thread/test/threads/thread/assign libs/thread/test/threads/thread/attributes libs/thread/test/threads/thread/constr libs/thread/test/threads/thread/destr libs/thread/test/threads/thread/id libs/thread/test/threads/thread/members libs/thread/test/threads/thread/non_members libs/thread/test/threads/thread/static libs/thread/test/threads/thread_group libs/thread/tutorial
From: anthony_at_[hidden]
Date: 2012-05-22 13:03:27


Author: anthonyw
Date: 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
New Revision: 78543
URL: http://svn.boost.org/trac/boost/changeset/78543

Log:
Merged boost.thread from trunk
Added:
   branches/release/boost/thread/cv_status.hpp
      - copied unchanged from r78538, /trunk/boost/thread/cv_status.hpp
   branches/release/boost/thread/detail/delete.hpp
      - copied unchanged from r78538, /trunk/boost/thread/detail/delete.hpp
   branches/release/boost/thread/detail/memory.hpp
      - copied unchanged from r78538, /trunk/boost/thread/detail/memory.hpp
   branches/release/boost/thread/reverse_lock.hpp
      - copied unchanged from r78538, /trunk/boost/thread/reverse_lock.hpp
   branches/release/boost/thread/shared_lock_guard.hpp
      - copied unchanged from r78538, /trunk/boost/thread/shared_lock_guard.hpp
   branches/release/boost/thread/v2/
      - copied from r78538, /trunk/boost/thread/v2/
   branches/release/boost/thread/v2/thread.hpp
      - copied unchanged from r78538, /trunk/boost/thread/v2/thread.hpp
   branches/release/libs/thread/doc/configuration.qbk
      - copied unchanged from r78538, /trunk/libs/thread/doc/configuration.qbk
   branches/release/libs/thread/doc/emulations.qbk
      - copied unchanged from r78538, /trunk/libs/thread/doc/emulations.qbk
   branches/release/libs/thread/doc/sync_tutorial.qbk
      - copied unchanged from r78538, /trunk/libs/thread/doc/sync_tutorial.qbk
   branches/release/libs/thread/example/shared_monitor.cpp
      - copied unchanged from r78538, /trunk/libs/thread/example/shared_monitor.cpp
   branches/release/libs/thread/example/shared_mutex.cpp
      - copied unchanged from r78538, /trunk/libs/thread/example/shared_mutex.cpp
   branches/release/libs/thread/src/future.cpp
      - copied unchanged from r78538, /trunk/libs/thread/src/future.cpp
   branches/release/libs/thread/src/shared_mutex.cpp
      - copied unchanged from r78538, /trunk/libs/thread/src/shared_mutex.cpp
   branches/release/libs/thread/test/sync/
      - copied from r78538, /trunk/libs/thread/test/sync/
   branches/release/libs/thread/test/sync/conditions/
      - copied from r78538, /trunk/libs/thread/test/sync/conditions/
   branches/release/libs/thread/test/sync/conditions/condition_variable/
      - copied from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable/
   branches/release/libs/thread/test/sync/conditions/condition_variable/assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable/assign_fail.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable/copy_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable/copy_fail.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable/default_pass.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable/dtor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable/dtor_pass.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable/native_handle_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable/native_handle_pass.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable/wait_for_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable/wait_for_pass.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable/wait_for_pred_pass.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable/wait_until_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable/wait_until_pass.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable/wait_until_pred_pass.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable_any/
      - copied from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable_any/
   branches/release/libs/thread/test/sync/conditions/condition_variable_any/assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable_any/assign_fail.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable_any/copy_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable_any/copy_fail.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable_any/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable_any/default_pass.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable_any/dtor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable_any/dtor_pass.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable_any/wait_for_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable_any/wait_for_pass.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable_any/wait_for_pred_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable_any/wait_for_pred_pass.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable_any/wait_until_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable_any/wait_until_pass.cpp
   branches/release/libs/thread/test/sync/conditions/condition_variable_any/wait_until_pred_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/condition_variable_any/wait_until_pred_pass.cpp
   branches/release/libs/thread/test/sync/conditions/cv_status/
      - copied from r78538, /trunk/libs/thread/test/sync/conditions/cv_status/
   branches/release/libs/thread/test/sync/conditions/cv_status/cv_status_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/conditions/cv_status/cv_status_pass.cpp
   branches/release/libs/thread/test/sync/futures/
      - copied from r78538, /trunk/libs/thread/test/sync/futures/
   branches/release/libs/thread/test/sync/futures/async/
      - copied from r78538, /trunk/libs/thread/test/sync/futures/async/
   branches/release/libs/thread/test/sync/futures/async/async_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/async/async_pass.cpp
   branches/release/libs/thread/test/sync/futures/errors/
      - copied from r78538, /trunk/libs/thread/test/sync/futures/errors/
   branches/release/libs/thread/test/sync/futures/future/
      - copied from r78538, /trunk/libs/thread/test/sync/futures/future/
   branches/release/libs/thread/test/sync/futures/future/copy_assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/future/copy_assign_fail.cpp
   branches/release/libs/thread/test/sync/futures/future/copy_ctor_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/future/copy_ctor_fail.cpp
   branches/release/libs/thread/test/sync/futures/future/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/future/default_pass.cpp
   branches/release/libs/thread/test/sync/futures/future/dtor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/future/dtor_pass.cpp
   branches/release/libs/thread/test/sync/futures/future/get_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/future/get_pass.cpp
   branches/release/libs/thread/test/sync/futures/future/move_assign_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/future/move_assign_pass.cpp
   branches/release/libs/thread/test/sync/futures/future/move_ctor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/future/move_ctor_pass.cpp
   branches/release/libs/thread/test/sync/futures/future/share_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/future/share_pass.cpp
   branches/release/libs/thread/test/sync/futures/future_errc/
      - copied from r78538, /trunk/libs/thread/test/sync/futures/future_errc/
   branches/release/libs/thread/test/sync/futures/future_errors/
      - copied from r78538, /trunk/libs/thread/test/sync/futures/future_errors/
   branches/release/libs/thread/test/sync/futures/future_status/
      - copied from r78538, /trunk/libs/thread/test/sync/futures/future_status/
   branches/release/libs/thread/test/sync/futures/packaged_task/
      - copied from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/
   branches/release/libs/thread/test/sync/futures/packaged_task/alloc_ctor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/alloc_ctor_pass.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/copy_assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/copy_assign_fail.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/copy_ctor_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/copy_ctor_fail.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/default_ctor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/default_ctor_pass.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/dtor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/dtor_pass.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/func_ctor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/func_ctor_pass.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/get_future_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/get_future_pass.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/member_swap_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/member_swap_pass.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/move_assign_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/move_assign_pass.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/move_ctor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/move_ctor_pass.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/non_member_swap_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/non_member_swap_pass.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/operator_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/operator_pass.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/reset_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/reset_pass.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/types_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/types_pass.cpp
   branches/release/libs/thread/test/sync/futures/packaged_task/use_allocator_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/packaged_task/use_allocator_pass.cpp
   branches/release/libs/thread/test/sync/futures/promise/
      - copied from r78538, /trunk/libs/thread/test/sync/futures/promise/
   branches/release/libs/thread/test/sync/futures/promise/alloc_ctor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/promise/alloc_ctor_pass.cpp
   branches/release/libs/thread/test/sync/futures/promise/copy_assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/promise/copy_assign_fail.cpp
   branches/release/libs/thread/test/sync/futures/promise/copy_ctor_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/promise/copy_ctor_fail.cpp
   branches/release/libs/thread/test/sync/futures/promise/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/promise/default_pass.cpp
   branches/release/libs/thread/test/sync/futures/promise/dtor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/promise/dtor_pass.cpp
   branches/release/libs/thread/test/sync/futures/promise/get_future_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/promise/get_future_pass.cpp
   branches/release/libs/thread/test/sync/futures/promise/move_assign_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/promise/move_assign_pass.cpp
   branches/release/libs/thread/test/sync/futures/promise/move_ctor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/promise/move_ctor_pass.cpp
   branches/release/libs/thread/test/sync/futures/promise/use_allocator_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/promise/use_allocator_pass.cpp
   branches/release/libs/thread/test/sync/futures/shared_future/
      - copied from r78538, /trunk/libs/thread/test/sync/futures/shared_future/
   branches/release/libs/thread/test/sync/futures/test_allocator.hpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/futures/test_allocator.hpp
   branches/release/libs/thread/test/sync/mutual_exclusion/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/
   branches/release/libs/thread/test/sync/mutual_exclusion/barrier/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/barrier/
   branches/release/libs/thread/test/sync/mutual_exclusion/lock_algorithm/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/lock_algorithm/
   branches/release/libs/thread/test/sync/mutual_exclusion/lock_algorithm/lock/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/lock_algorithm/lock/
   branches/release/libs/thread/test/sync/mutual_exclusion/lock_algorithm/try_lock/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/lock_algorithm/try_lock/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/lock_guard/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/lock_guard/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/lock_guard/adopt_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/lock_guard/adopt_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/lock_guard/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/lock_guard/default_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/lock_guard/types_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/lock_guard/types_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/reverse_lock/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/reverse_lock/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/reverse_lock/copy_assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/reverse_lock/copy_assign_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/reverse_lock/copy_ctor_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/reverse_lock/copy_ctor_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/reverse_lock/types_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/reverse_lock/types_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/reverse_lock/unique_lock_ctor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/reverse_lock/unique_lock_ctor_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/adopt_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/adopt_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_assign_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_ctor_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/copy_ctor_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/default_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/defer_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/defer_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/duration_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/duration_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_unique_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_unique_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_upgrade_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_upgrade_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/mutex_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/mutex_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/time_point_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/time_point_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/try_to_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/try_to_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/locking/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/locking/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/locking/lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/locking/lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_for_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_for_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/locking/unlock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/locking/unlock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/mod/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/mod/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/mod/member_swap_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/mod/member_swap_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/mod/non_member_swap_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/mod/non_member_swap_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/mod/release_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/mod/release_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/obs/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/obs/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/obs/mutex_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/obs/mutex_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/obs/op_bool_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/obs/op_bool_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/obs/owns_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/obs/owns_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/types_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/types_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/default_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/types_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock_guard/types_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/adopt_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/adopt_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_assign_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_ctor_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/copy_ctor_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/default_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/defer_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/defer_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/duration_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/duration_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_for_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_for_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_try_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_try_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_until_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_until_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_for_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_for_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_try_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_try_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_until_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_until_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/mutex_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/mutex_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/time_point_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/time_point_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/try_to_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/try_to_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/locking/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/locking/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/locking/lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/locking/lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_for_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_for_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/locking/unlock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/locking/unlock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/mod/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/mod/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/mod/member_swap_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/mod/member_swap_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/mod/non_member_swap_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/mod/non_member_swap_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/mod/release_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/mod/release_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/obs/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/obs/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/obs/mutex_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/obs/mutex_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/obs/op_bool_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/obs/op_bool_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/obs/op_int_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/obs/op_int_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/obs/owns_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/obs/owns_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/types_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/types_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/adopt_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/adopt_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_assign_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_ctor_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/copy_ctor_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/default_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/defer_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/defer_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/duration_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/duration_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_for_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_for_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_try_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_try_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_until_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_until_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_unique_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_unique_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/mutex_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/mutex_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/time_point_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/time_point_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/try_to_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/try_to_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/locking/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/locking/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/locking/lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/locking/lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_for_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_for_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/locking/unlock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/locking/unlock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/mod/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/mod/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/mod/member_swap_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/mod/member_swap_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/mod/non_member_swap_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/mod/non_member_swap_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/mod/release_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/mod/release_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/obs/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/obs/
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/obs/mutex_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/obs/mutex_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/obs/op_bool_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/obs/op_bool_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/obs/owns_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/obs/owns_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/types_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/types_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/locks/upgrade_to_unique_lock/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_to_unique_lock/
   branches/release/libs/thread/test/sync/mutual_exclusion/mutex/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/mutex/
   branches/release/libs/thread/test/sync/mutual_exclusion/mutex/assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/mutex/assign_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/mutex/copy_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/mutex/copy_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/mutex/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/mutex/default_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/mutex/lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/mutex/lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/mutex/native_handle_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/mutex/native_handle_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/mutex/try_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/mutex/try_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/once/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/once/
   branches/release/libs/thread/test/sync/mutual_exclusion/once/call_once/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/once/call_once/
   branches/release/libs/thread/test/sync/mutual_exclusion/once/once_flag/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/once/once_flag/
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_mutex/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_mutex/
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_mutex/assign_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_mutex/copy_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_mutex/copy_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_mutex/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_mutex/default_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_mutex/lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_mutex/lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_mutex/native_handle_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_mutex/native_handle_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_mutex/try_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_mutex/try_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/assign_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/copy_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/copy_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/default_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/native_handle_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/native_handle_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_until_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/recursive_timed_mutex/try_lock_until_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/shared_mutex/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/shared_mutex/
   branches/release/libs/thread/test/sync/mutual_exclusion/shared_mutex/assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/shared_mutex/assign_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/shared_mutex/copy_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/shared_mutex/copy_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/shared_mutex/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/shared_mutex/default_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/shared_mutex/lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/shared_mutex/lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/shared_mutex/try_lock_for_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/shared_mutex/try_lock_for_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/shared_mutex/try_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/shared_mutex/try_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/shared_mutex/try_lock_until_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/shared_mutex/try_lock_until_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/timed_mutex/
      - copied from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/timed_mutex/
   branches/release/libs/thread/test/sync/mutual_exclusion/timed_mutex/assign_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/timed_mutex/assign_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/timed_mutex/copy_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/timed_mutex/copy_fail.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/timed_mutex/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/timed_mutex/default_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/timed_mutex/lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/timed_mutex/lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/timed_mutex/native_handle_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/timed_mutex/native_handle_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/timed_mutex/try_lock_for_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/timed_mutex/try_lock_for_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/timed_mutex/try_lock_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/timed_mutex/try_lock_pass.cpp
   branches/release/libs/thread/test/sync/mutual_exclusion/timed_mutex/try_lock_until_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/sync/mutual_exclusion/timed_mutex/try_lock_until_pass.cpp
   branches/release/libs/thread/test/test_2309.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_2309.cpp
   branches/release/libs/thread/test/test_2501.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_2501.cpp
   branches/release/libs/thread/test/test_2741.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_2741.cpp
   branches/release/libs/thread/test/test_4521.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_4521.cpp
   branches/release/libs/thread/test/test_4648.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_4648.cpp
   branches/release/libs/thread/test/test_4882.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_4882.cpp
   branches/release/libs/thread/test/test_5351.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_5351.cpp
   branches/release/libs/thread/test/test_5502.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_5502.cpp
   branches/release/libs/thread/test/test_5542_1.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_5542_1.cpp
   branches/release/libs/thread/test/test_5542_2.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_5542_2.cpp
   branches/release/libs/thread/test/test_5542_3.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_5542_3.cpp
   branches/release/libs/thread/test/test_5891.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_5891.cpp
   branches/release/libs/thread/test/test_6130.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_6130.cpp
   branches/release/libs/thread/test/test_6174.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_6174.cpp
   branches/release/libs/thread/test/test_ml.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_ml.cpp
   branches/release/libs/thread/test/test_shared_mutex_timed_locks_chrono.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/test_shared_mutex_timed_locks_chrono.cpp
   branches/release/libs/thread/test/threads/
      - copied from r78538, /trunk/libs/thread/test/threads/
   branches/release/libs/thread/test/threads/container/
      - copied from r78538, /trunk/libs/thread/test/threads/container/
   branches/release/libs/thread/test/threads/container/thread_ptr_list_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/container/thread_ptr_list_pass.cpp
   branches/release/libs/thread/test/threads/container/thread_vector_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/container/thread_vector_pass.cpp
   branches/release/libs/thread/test/threads/this_thread/
      - copied from r78538, /trunk/libs/thread/test/threads/this_thread/
   branches/release/libs/thread/test/threads/this_thread/at_thread_exit/
      - copied from r78538, /trunk/libs/thread/test/threads/this_thread/at_thread_exit/
   branches/release/libs/thread/test/threads/this_thread/disable_interruption/
      - copied from r78538, /trunk/libs/thread/test/threads/this_thread/disable_interruption/
   branches/release/libs/thread/test/threads/this_thread/get_id/
      - copied from r78538, /trunk/libs/thread/test/threads/this_thread/get_id/
   branches/release/libs/thread/test/threads/this_thread/get_id/get_id_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/this_thread/get_id/get_id_pass.cpp
   branches/release/libs/thread/test/threads/this_thread/interruption_enabled/
      - copied from r78538, /trunk/libs/thread/test/threads/this_thread/interruption_enabled/
   branches/release/libs/thread/test/threads/this_thread/interruption_point/
      - copied from r78538, /trunk/libs/thread/test/threads/this_thread/interruption_point/
   branches/release/libs/thread/test/threads/this_thread/interruption_requested/
      - copied from r78538, /trunk/libs/thread/test/threads/this_thread/interruption_requested/
   branches/release/libs/thread/test/threads/this_thread/restore_interruption/
      - copied from r78538, /trunk/libs/thread/test/threads/this_thread/restore_interruption/
   branches/release/libs/thread/test/threads/this_thread/sleep_for/
      - copied from r78538, /trunk/libs/thread/test/threads/this_thread/sleep_for/
   branches/release/libs/thread/test/threads/this_thread/sleep_for/sleep_for_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/this_thread/sleep_for/sleep_for_pass.cpp
   branches/release/libs/thread/test/threads/this_thread/sleep_until/
      - copied from r78538, /trunk/libs/thread/test/threads/this_thread/sleep_until/
   branches/release/libs/thread/test/threads/this_thread/sleep_until/sleep_until_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/this_thread/sleep_until/sleep_until_pass.cpp
   branches/release/libs/thread/test/threads/this_thread/yield/
      - copied from r78538, /trunk/libs/thread/test/threads/this_thread/yield/
   branches/release/libs/thread/test/threads/thread/
      - copied from r78538, /trunk/libs/thread/test/threads/thread/
   branches/release/libs/thread/test/threads/thread/assign/
      - copied from r78538, /trunk/libs/thread/test/threads/thread/assign/
   branches/release/libs/thread/test/threads/thread/assign/copy_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/assign/copy_fail.cpp
   branches/release/libs/thread/test/threads/thread/assign/move_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/assign/move_pass.cpp
   branches/release/libs/thread/test/threads/thread/attributes/
      - copied from r78538, /trunk/libs/thread/test/threads/thread/attributes/
   branches/release/libs/thread/test/threads/thread/constr/
      - copied from r78538, /trunk/libs/thread/test/threads/thread/constr/
   branches/release/libs/thread/test/threads/thread/constr/FArgs_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/constr/FArgs_pass.cpp
   branches/release/libs/thread/test/threads/thread/constr/F_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/constr/F_pass.cpp
   branches/release/libs/thread/test/threads/thread/constr/FrvalueArgs_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/constr/FrvalueArgs_pass.cpp
   branches/release/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp
   branches/release/libs/thread/test/threads/thread/constr/copy_fail.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/constr/copy_fail.cpp
   branches/release/libs/thread/test/threads/thread/constr/default_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/constr/default_pass.cpp
   branches/release/libs/thread/test/threads/thread/constr/move_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/constr/move_pass.cpp
   branches/release/libs/thread/test/threads/thread/destr/
      - copied from r78538, /trunk/libs/thread/test/threads/thread/destr/
   branches/release/libs/thread/test/threads/thread/destr/dtor_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/destr/dtor_pass.cpp
   branches/release/libs/thread/test/threads/thread/id/
      - copied from r78538, /trunk/libs/thread/test/threads/thread/id/
   branches/release/libs/thread/test/threads/thread/id/hash_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/id/hash_pass.cpp
   branches/release/libs/thread/test/threads/thread/members/
      - copied from r78538, /trunk/libs/thread/test/threads/thread/members/
   branches/release/libs/thread/test/threads/thread/members/detach_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/members/detach_pass.cpp
   branches/release/libs/thread/test/threads/thread/members/get_id_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/members/get_id_pass.cpp
   branches/release/libs/thread/test/threads/thread/members/join_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/members/join_pass.cpp
   branches/release/libs/thread/test/threads/thread/members/joinable_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/members/joinable_pass.cpp
   branches/release/libs/thread/test/threads/thread/members/native_handle_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/members/native_handle_pass.cpp
   branches/release/libs/thread/test/threads/thread/members/swap_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/members/swap_pass.cpp
   branches/release/libs/thread/test/threads/thread/non_members/
      - copied from r78538, /trunk/libs/thread/test/threads/thread/non_members/
   branches/release/libs/thread/test/threads/thread/non_members/swap_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/non_members/swap_pass.cpp
   branches/release/libs/thread/test/threads/thread/static/
      - copied from r78538, /trunk/libs/thread/test/threads/thread/static/
   branches/release/libs/thread/test/threads/thread/static/hardware_concurrency_pass.cpp
      - copied unchanged from r78538, /trunk/libs/thread/test/threads/thread/static/hardware_concurrency_pass.cpp
   branches/release/libs/thread/test/threads/thread_group/
      - copied from r78538, /trunk/libs/thread/test/threads/thread_group/
Removed:
   branches/release/libs/thread/tutorial/helloworld4.cpp
Properties modified:
   branches/release/boost/detail/scoped_enum_emulation.hpp (contents, props changed)
   branches/release/boost/thread/ (props changed)
   branches/release/boost/thread.hpp (props changed)
   branches/release/libs/thread/ (props changed)
   branches/release/libs/thread/test/ (props changed)
Text files modified:
   branches/release/boost/detail/scoped_enum_emulation.hpp | 349 ++++++++++-
   branches/release/boost/thread/barrier.hpp | 8
   branches/release/boost/thread/detail/config.hpp | 111 +++
   branches/release/boost/thread/detail/move.hpp | 182 ++++++
   branches/release/boost/thread/detail/platform.hpp | 4
   branches/release/boost/thread/detail/thread.hpp | 338 +++++++----
   branches/release/boost/thread/detail/thread_interruption.hpp | 23
   branches/release/boost/thread/exceptions.hpp | 211 ++++--
   branches/release/boost/thread/future.hpp | 923 +++++++++++++++++++------------
   branches/release/boost/thread/locks.hpp | 891 +++++++++++++++++++------------
   branches/release/boost/thread/once.hpp | 4
   branches/release/boost/thread/pthread/condition_variable.hpp | 171 ++++-
   branches/release/boost/thread/pthread/condition_variable_fwd.hpp | 155 ++++
   branches/release/boost/thread/pthread/mutex.hpp | 100 ++
   branches/release/boost/thread/pthread/once.hpp | 29
   branches/release/boost/thread/pthread/recursive_mutex.hpp | 97 ++
   branches/release/boost/thread/pthread/shared_mutex.hpp | 252 ++++++++
   branches/release/boost/thread/pthread/thread_data.hpp | 53 +
   branches/release/boost/thread/shared_mutex.hpp | 9
   branches/release/boost/thread/thread.hpp | 3
   branches/release/boost/thread/win32/basic_recursive_mutex.hpp | 42 +
   branches/release/boost/thread/win32/basic_timed_mutex.hpp | 58 +
   branches/release/boost/thread/win32/condition_variable.hpp | 137 ++++
   branches/release/boost/thread/win32/mutex.hpp | 10
   branches/release/boost/thread/win32/once.hpp | 45 +
   branches/release/boost/thread/win32/recursive_mutex.hpp | 9
   branches/release/boost/thread/win32/shared_mutex.hpp | 253 ++++++++
   branches/release/boost/thread/win32/thread_data.hpp | 51 +
   branches/release/libs/thread/build/Jamfile.v2 | 78 ++
   branches/release/libs/thread/doc/Jamfile.v2 | 9
   branches/release/libs/thread/doc/changes.qbk | 94 ++
   branches/release/libs/thread/doc/condition_variables.qbk | 283 +++++++++
   branches/release/libs/thread/doc/future_ref.qbk | 352 ++++++++++--
   branches/release/libs/thread/doc/futures.qbk | 2
   branches/release/libs/thread/doc/mutex_concepts.qbk | 1146 ++++++++++++++++++++++++++++++++++-----
   branches/release/libs/thread/doc/mutexes.qbk | 31
   branches/release/libs/thread/doc/once.qbk | 29
   branches/release/libs/thread/doc/overview.qbk | 25
   branches/release/libs/thread/doc/shared_mutex_ref.qbk | 107 +++
   branches/release/libs/thread/doc/thread.qbk | 86 ++
   branches/release/libs/thread/doc/thread_ref.qbk | 759 ++++++++++++++++++++++---
   branches/release/libs/thread/doc/time.qbk | 23
   branches/release/libs/thread/example/condition.cpp | 2
   branches/release/libs/thread/example/monitor.cpp | 3
   branches/release/libs/thread/example/once.cpp | 11
   branches/release/libs/thread/example/starvephil.cpp | 4
   branches/release/libs/thread/example/thread.cpp | 4
   branches/release/libs/thread/example/thread_group.cpp | 4
   branches/release/libs/thread/example/tss.cpp | 4
   branches/release/libs/thread/example/xtime.cpp | 4
   branches/release/libs/thread/src/pthread/once.cpp | 27
   branches/release/libs/thread/src/pthread/thread.cpp | 141 ++++
   branches/release/libs/thread/src/win32/thread.cpp | 117 +++-
   branches/release/libs/thread/src/win32/tss_pe.cpp | 2
   branches/release/libs/thread/test/Jamfile.v2 | 531 +++++++++++++++++-
   branches/release/libs/thread/test/no_implicit_assign_from_lvalue_thread.cpp | 14
   branches/release/libs/thread/test/no_implicit_move_from_lvalue_thread.cpp | 14
   branches/release/libs/thread/test/test_barrier.cpp | 17
   branches/release/libs/thread/test/test_condition.cpp | 17
   branches/release/libs/thread/test/test_condition_notify_all.cpp | 19
   branches/release/libs/thread/test/test_condition_notify_one.cpp | 29
   branches/release/libs/thread/test/test_condition_timed_wait_times_out.cpp | 23
   branches/release/libs/thread/test/test_futures.cpp | 451 +++++++++------
   branches/release/libs/thread/test/test_generic_locks.cpp | 95 +-
   branches/release/libs/thread/test/test_hardware_concurrency.cpp | 15
   branches/release/libs/thread/test/test_lock_concept.cpp | 78 +-
   branches/release/libs/thread/test/test_move_function.cpp | 23
   branches/release/libs/thread/test/test_mutex.cpp | 31
   branches/release/libs/thread/test/test_once.cpp | 25
   branches/release/libs/thread/test/test_shared_mutex.cpp | 25
   branches/release/libs/thread/test/test_shared_mutex_part_2.cpp | 27
   branches/release/libs/thread/test/test_shared_mutex_timed_locks.cpp | 15
   branches/release/libs/thread/test/test_thread.cpp | 36
   branches/release/libs/thread/test/test_thread_exit.cpp | 15
   branches/release/libs/thread/test/test_thread_id.cpp | 21
   branches/release/libs/thread/test/test_thread_launching.cpp | 40
   branches/release/libs/thread/test/test_thread_move.cpp | 16
   branches/release/libs/thread/test/test_thread_move_return.cpp | 19
   branches/release/libs/thread/test/test_thread_return_local.cpp | 21
   branches/release/libs/thread/test/test_tss.cpp | 28
   branches/release/libs/thread/test/test_xtime.cpp | 18
   branches/release/libs/thread/test/util.inl | 52 +
   82 files changed, 7570 insertions(+), 2010 deletions(-)

Modified: branches/release/boost/detail/scoped_enum_emulation.hpp
==============================================================================
--- branches/release/boost/detail/scoped_enum_emulation.hpp (original)
+++ branches/release/boost/detail/scoped_enum_emulation.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,56 +1,337 @@
 // scoped_enum_emulation.hpp ---------------------------------------------------------//
 
 // Copyright Beman Dawes, 2009
+// Copyright (C) 2011-2012 Vicente J. Botet Escriba
+// Copyright (C) 2012 Anthony Williams
 
 // Distributed under the Boost Software License, Version 1.0.
 // See http://www.boost.org/LICENSE_1_0.txt
 
-// Generates C++0x scoped enums if the feature is present, otherwise emulates C++0x
-// scoped enums with C++03 namespaces and enums. The Boost.Config BOOST_NO_SCOPED_ENUMS
-// macro is used to detect feature support.
-//
-// See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf for a
-// description of the scoped enum feature. Note that the committee changed the name
-// from strongly typed enum to scoped enum.
-//
-// Caution: only the syntax is emulated; the semantics are not emulated and
-// the syntax emulation doesn't include being able to specify the underlying
-// representation type.
-//
-// The emulation is via struct rather than namespace to allow use within classes.
-// Thanks to Andrey Semashev for pointing that out.
-//
-// Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott,
-// Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vincente
-// Botet, and Daniel James.
-//
-// Sample usage:
-//
-// BOOST_SCOPED_ENUM_START(algae) { green, red, cyan }; BOOST_SCOPED_ENUM_END
-// ...
-// BOOST_SCOPED_ENUM(algae) sample( algae::red );
-// void foo( BOOST_SCOPED_ENUM(algae) color );
-// ...
-// sample = algae::green;
-// foo( algae::cyan );
+/*
+[section:scoped_enums Scoped Enums]
+
+Generates C++0x scoped enums if the feature is present, otherwise emulates C++0x
+scoped enums with C++03 namespaces and enums. The Boost.Config BOOST_NO_SCOPED_ENUMS
+macro is used to detect feature support.
+
+See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf for a
+description of the scoped enum feature. Note that the committee changed the name
+from strongly typed enum to scoped enum.
+
+Some of the enumerations defined in the standard library are scoped enums.
+
+ enum class future_errc
+ {
+ broken_promise,
+ future_already_retrieved,
+ promise_already_satisfied,
+ no_state
+ };
+
+On compilers that don't support them, the library provides two emulations:
+
+[heading Strict]
+
+* Able to specify the underlying type.
+* explicit conversion to/from underlying type.
+* The wrapper is not a C++03 enum type.
+
+The user can declare declare these types as
+
+ BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_errc)
+ {
+ broken_promise,
+ future_already_retrieved,
+ promise_already_satisfied,
+ no_state
+ }
+ BOOST_SCOPED_ENUM_DECLARE_END(future_errc)
+
+These macros allows to use 'future_errc' in almost all the cases as an scoped enum.
+
+ future_errc err = future_errc::no_state;
+
+There are however some limitations:
+
+* The type is not a C++ enum, so 'is_enum<future_errc>' will be false_type.
+* The emulated scoped enum can not be used in switch nor in template arguments. For these cases the user needs to use some macros.
+
+Instead of
+
+ switch (ev)
+ {
+ case future_errc::broken_promise:
+ // ...
+
+use
+
+ switch (boost::native_value(ev))
+ {
+ case future_errc::broken_promise:
+
+And instead of
+
+ #ifdef BOOST_NO_SCOPED_ENUMS
+ template <>
+ struct BOOST_SYMBOL_VISIBLE is_error_code_enum<future_errc> : public true_type { };
+ #endif
+
+use
+
+ #ifdef BOOST_NO_SCOPED_ENUMS
+ template <>
+ struct BOOST_SYMBOL_VISIBLE is_error_code_enum<future_errc::enum_type > : public true_type { };
+ #endif
+
+
+Sample usage:
+
+ BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(algae, char) { green, red, cyan }; BOOST_SCOPED_ENUM_DECLARE_END(algae)
+ ...
+ algae sample( algae::red );
+ void foo( algae color );
+ ...
+ sample = algae::green;
+ foo( algae::cyan );
+
+ Light
+ Caution: only the syntax is emulated; the semantics are not emulated and
+ the syntax emulation doesn't include being able to specify the underlying
+ representation type.
+
+ The literal scoped emulation is via struct rather than namespace to allow use within classes.
+ Thanks to Andrey Semashev for pointing that out.
+ However the type is an real C++03 enum and so convertible implicitly to an int.
+
+ Sample usage:
+
+ BOOST_SCOPED_ENUM_START(algae) { green, red, cyan }; BOOST_SCOPED_ENUM_END
+ ...
+ BOOST_SCOPED_ENUM(algae) sample( algae::red );
+ void foo( BOOST_SCOPED_ENUM(algae) color );
+ ...
+ sample = algae::green;
+ foo( algae::cyan );
+
+ Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott,
+ Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vicente
+ Botet, and Daniel James.
+
+[endsect]
+*/
+
 
 #ifndef BOOST_SCOPED_ENUM_EMULATION_HPP
 #define BOOST_SCOPED_ENUM_EMULATION_HPP
 
 #include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+namespace boost
+{
+
+#ifdef BOOST_NO_SCOPED_ENUMS
+ /**
+ * Meta-function to get the underlying type of a scoped enum.
+ *
+ * Requires EnumType must be an enum type or the emulation of a scoped enum
+ */
+ template <typename EnumType>
+ struct underlying_type
+ {
+ /**
+ * The member typedef type names the underlying type of EnumType. It is EnumType::underlying_type when the EnumType is an emulated scoped enum,
+ * std::underlying_type<EnumType>::type when the standard library std::underlying_type is provided.
+ *
+ * The user will need to specialize it when the compiler supports scoped enums but don't provides std::underlying_type.
+ */
+ typedef typename EnumType::underlying_type type;
+ };
+
+ /**
+ * Meta-function to get the native enum type associated to an enum class or its emulation.
+ */
+ template <typename EnumType>
+ struct native_type
+ {
+ /**
+ * The member typedef type names the native enum type associated to the scoped enum,
+ * which is it self if the compiler supports scoped enums or EnumType::enum_type if it is an emulated scoped enum.
+ */
+ typedef typename EnumType::enum_type type;
+ };
+
+ /**
+ * Casts a scoped enum to its underlying type.
+ *
+ * This function is useful when working with scoped enum classes, which doens't implicitly convert to the underlying type.
+ * @param v A scoped enum.
+ * @returns The underlying type.
+ * @throws No-throws.
+ */
+ template <typename UnderlyingType, typename EnumType>
+ UnderlyingType underlying_cast(EnumType v)
+ {
+ return v.get_underlying_value_();
+ }
+
+ /**
+ * Casts a scoped enum to its native enum type.
+ *
+ * This function is useful to make programs portable when the scoped enum emulation can not be use where native enums can.
+ *
+ * EnumType the scoped enum type
+ *
+ * @param v A scoped enum.
+ * @returns The native enum value.
+ * @throws No-throws.
+ */
+ template <typename EnumType>
+ inline
+ typename EnumType::enum_type native_value(EnumType e)
+ {
+ return e.native_value_();
+ }
+
+#else // BOOST_NO_SCOPED_ENUMS
+
+ template <typename EnumType>
+ struct underlying_type
+ {
+ //typedef typename std::underlying_type<EnumType>::type type;
+ };
+
+ template <typename EnumType>
+ struct native_type
+ {
+ typedef EnumType type;
+ };
+
+ template <typename UnderlyingType, typename EnumType>
+ UnderlyingType underlying_cast(EnumType v)
+ {
+ return static_cast<UnderlyingType>(v);
+ }
+
+ template <typename EnumType>
+ inline
+ EnumType native_value(EnumType e)
+ {
+ return e;
+ }
+
+#endif
+}
+
 
 #ifdef BOOST_NO_SCOPED_ENUMS
 
-# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_type
-# define BOOST_SCOPED_ENUM_END };
-# define BOOST_SCOPED_ENUM(name) name::enum_type
+#ifndef BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
+
+#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
+ explicit operator underlying_type() const { return get_underlying_value_(); }
 
 #else
 
-# define BOOST_SCOPED_ENUM_START(name) enum class name
-# define BOOST_SCOPED_ENUM_END
-# define BOOST_SCOPED_ENUM(name) name
+#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR
 
 #endif
 
+/**
+ * Start a declaration of a scoped enum.
+ *
+ * @param EnumType The new scoped enum.
+ * @param UnderlyingType The underlying type.
+ */
+#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType, UnderlyingType) \
+ struct EnumType { \
+ typedef UnderlyingType underlying_type; \
+ EnumType() BOOST_NOEXCEPT {} \
+ explicit EnumType(underlying_type v) : v_(v) {} \
+ underlying_type get_underlying_value_() const { return v_; } \
+ BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
+ private: \
+ underlying_type v_; \
+ typedef EnumType self_type; \
+ public: \
+ enum enum_type
+
+#define BOOST_SCOPED_ENUM_DECLARE_END2() \
+ enum_type get_native_value_() const BOOST_NOEXCEPT { return enum_type(v_); } \
+ operator enum_type() const BOOST_NOEXCEPT { return get_native_value_(); } \
+ friend bool operator ==(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==enum_type(rhs.v_); } \
+ friend bool operator ==(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==rhs; } \
+ friend bool operator ==(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs==enum_type(rhs.v_); } \
+ friend bool operator !=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=enum_type(rhs.v_); } \
+ friend bool operator !=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=rhs; } \
+ friend bool operator !=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs!=enum_type(rhs.v_); } \
+ friend bool operator <(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<enum_type(rhs.v_); } \
+ friend bool operator <(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<rhs; } \
+ friend bool operator <(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs<enum_type(rhs.v_); } \
+ friend bool operator <=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<=enum_type(rhs.v_); } \
+ friend bool operator <=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<=rhs; } \
+ friend bool operator <=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs<=enum_type(rhs.v_); } \
+ friend bool operator >(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>enum_type(rhs.v_); } \
+ friend bool operator >(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>rhs; } \
+ friend bool operator >(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>enum_type(rhs.v_); } \
+ friend bool operator >=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=enum_type(rhs.v_); } \
+ friend bool operator >=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=rhs; } \
+ friend bool operator >=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>=enum_type(rhs.v_); } \
+ };
+
+#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) \
+ ; \
+ EnumType(enum_type v) BOOST_NOEXCEPT : v_(v) {} \
+ BOOST_SCOPED_ENUM_DECLARE_END2()
+
+/**
+ * Starts a declaration of a scoped enum with the default int underlying type.
+ *
+ * @param EnumType The new scoped enum.
+ */
+#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) \
+ BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,int)
+
+/**
+ * Name of the native enum type.
+ *
+ * @param NT The new scoped enum.
+ */
+#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType::enum_type
+/**
+ * Forward declares an scoped enum.
+ *
+ * @param NT The scoped enum.
+ */
+#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) struct EnumType
+
+#else // BOOST_NO_SCOPED_ENUMS
+
+#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,UnderlyingType) enum class EnumType:UnderlyingType
+#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) enum class EnumType
+#define BOOST_SCOPED_ENUM_DECLARE_END2()
+#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) ;
+
+#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType
+#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) enum class EnumType
+
+#endif // BOOST_NO_SCOPED_ENUMS
+
+#define BOOST_SCOPED_ENUM_START(name) BOOST_SCOPED_ENUM_DECLARE_BEGIN(name)
+#define BOOST_SCOPED_ENUM_END BOOST_SCOPED_ENUM_DECLARE_END2()
+#define BOOST_SCOPED_ENUM(name) BOOST_SCOPED_ENUM_NATIVE(name)
+
+//#ifdef BOOST_NO_SCOPED_ENUMS
+//
+//# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_type
+//# define BOOST_SCOPED_ENUM_END };
+//# define BOOST_SCOPED_ENUM(name) name::enum_type
+//
+//#else
+//
+//# define BOOST_SCOPED_ENUM_START(name) enum class name
+//# define BOOST_SCOPED_ENUM_END
+//# define BOOST_SCOPED_ENUM(name) name
+//
+//#endif
 #endif // BOOST_SCOPED_ENUM_EMULATION_HPP

Modified: branches/release/boost/thread/barrier.hpp
==============================================================================
--- branches/release/boost/thread/barrier.hpp (original)
+++ branches/release/boost/thread/barrier.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -2,7 +2,7 @@
 // David Moore, William E. Kempf
 // Copyright (C) 2007-8 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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)
 
 #ifndef BOOST_BARRIER_JDM030602_HPP
@@ -28,14 +28,14 @@
             : m_threshold(count), m_count(count), m_generation(0)
         {
             if (count == 0)
- boost::throw_exception(std::invalid_argument("count cannot be zero."));
+ boost::throw_exception(thread_exception(system::errc::invalid_argument, "barrier constructor: count cannot be zero."));
         }
-
+
         bool wait()
         {
             boost::mutex::scoped_lock lock(m_mutex);
             unsigned int gen = m_generation;
-
+
             if (--m_count == 0)
             {
                 m_generation++;

Modified: branches/release/boost/thread/detail/config.hpp
==============================================================================
--- branches/release/boost/thread/detail/config.hpp (original)
+++ branches/release/boost/thread/detail/config.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,5 +1,6 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
+// Copyright (C) 2011-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)
@@ -10,13 +11,117 @@
 #include <boost/config.hpp>
 #include <boost/detail/workaround.hpp>
 
+// This compiler doesn't support Boost.Chrono
+#if defined __IBMCPP__ && (__IBMCPP__ < 1100)
+#define BOOST_THREAD_DONT_USE_CHRONO
+#endif
+
+// This compiler doesn't support Boost.Move
+#if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
+#define BOOST_THREAD_DONT_USE_MOVE
+#endif
 
+// This compiler doesn't support Boost.Container Allocators files
+#if defined __SUNPRO_CC
+#define BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
+#endif
+
+#if defined _WIN32_WCE && _WIN32_WCE==0x501
+#define BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
+#endif
+
+#if ! defined BOOST_THREAD_DONT_PROVIDE_BASIC_THREAD_ID
+#define BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
+#endif
+
+// Default version is 2
 #if !defined BOOST_THREAD_VERSION
-#define BOOST_THREAD_VERSION 1
+#define BOOST_THREAD_VERSION 2
 #else
-#if BOOST_THREAD_VERSION!=1 && BOOST_THREAD_VERSION!=2
-#error "BOOST_THREAD_VERSION must be 1 or 2"
+#if BOOST_THREAD_VERSION!=2 && BOOST_THREAD_VERSION!=3
+#error "BOOST_THREAD_VERSION must be 2 or 3"
+#endif
+#endif
+
+// Uses Boost.System by default if not stated the opposite defining BOOST_THREAD_DONT_USE_SYSTEM
+#if ! defined BOOST_THREAD_DONT_USE_SYSTEM
+#define BOOST_THREAD_USES_SYSTEM
+#endif
+
+// Uses Boost.Chrono by default if not stated the opposite defining BOOST_THREAD_DONT_USE_CHRONO or BOOST_THREAD_DONT_USE_SYSTEM
+#if ! defined BOOST_THREAD_DONT_USE_CHRONO && ! defined BOOST_THREAD_DONT_USE_SYSTEM
+#define BOOST_THREAD_USES_CHRONO
+#endif
+
+// Don't provided by default in version 1.
+#if defined BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
+#define BOOST_THREAD_EXPLICIT_LOCK_CONVERSION explicit
+#else
+#define BOOST_THREAD_EXPLICIT_LOCK_CONVERSION
+#endif
+
+
+// Uses Boost.Move by default if not stated the opposite defining BOOST_THREAD_DONT_USE_MOVE
+#if ! defined BOOST_THREAD_DONT_USE_MOVE
+#if ! defined BOOST_THREAD_USES_MOVE
+//#define BOOST_THREAD_USES_MOVE
+#endif
 #endif
+
+#if BOOST_THREAD_VERSION==2
+#if ! defined BOOST_THREAD_DONT_PROVIDE_PROMISE_LAZY
+#define BOOST_THREAD_PROMISE_LAZY
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0
+#define BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
+#endif
+#endif
+
+#if BOOST_THREAD_VERSION==3
+#if ! defined BOOST_THREAD_DONT_PROVIDE_ONCE_CXX11
+#define BOOST_THREAD_PROVIDES_ONCE_CXX11
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
+#define BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
+#define BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE
+#define BOOST_THREAD_PROVIDES_FUTURE
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_FUTURE_CTOR_ALLOCATORS
+#define BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_SHARED_MUTEX_UPWARDS_CONVERSIONS
+#define BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_EXPLICIT_LOCK_CONVERSION
+#define BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
+#endif
+#if ! defined BOOST_THREAD_DONT_PROVIDE_GENERIC_SHARED_MUTEX_ON_WIN
+#define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
+#endif
+#if ! defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
+#define BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0
+#endif
+#if ! defined BOOST_THREAD_DONT_USE_MOVE
+#if ! defined BOOST_THREAD_USES_MOVE
+#define BOOST_THREAD_USES_MOVE
+#endif
+#endif
+
+#endif
+
+// BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN is defined if BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+#if defined BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+#define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
+#endif
+
+// BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 defined by default up to Boost 1.52
+// BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0 defined by default up to Boost 1.55
+#if ! defined BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0
+#define BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
 #endif
 
 #if BOOST_WORKAROUND(__BORLANDC__, < 0x600)

Modified: branches/release/boost/thread/detail/move.hpp
==============================================================================
--- branches/release/boost/thread/detail/move.hpp (original)
+++ branches/release/boost/thread/detail/move.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -2,6 +2,7 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 
 #ifndef BOOST_THREAD_MOVE_HPP
 #define BOOST_THREAD_MOVE_HPP
@@ -11,10 +12,12 @@
 #include <boost/utility/enable_if.hpp>
 #include <boost/type_traits/is_convertible.hpp>
 #include <boost/type_traits/remove_reference.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/decay.hpp>
 #endif
 
+#include <boost/thread/detail/delete.hpp>
 #include <boost/move/move.hpp>
-
 #include <boost/config/abi_prefix.hpp>
 
 namespace boost
@@ -22,6 +25,8 @@
 
     namespace detail
     {
+ template <typename T>
+ struct has_move_emulation_enabled_aux_dummy_specialization;
         template<typename T>
         struct thread_move_t
         {
@@ -44,6 +49,7 @@
         };
     }
 
+
 #ifndef BOOST_NO_SFINAE
     template<typename T>
     typename enable_if<boost::is_convertible<T&,boost::detail::thread_move_t<T> >, boost::detail::thread_move_t<T> >::type move(T& t)
@@ -57,9 +63,183 @@
     {
         return t;
     }
+}
+
+#if ! defined BOOST_NO_RVALUE_REFERENCES
+
+#define BOOST_THREAD_RV_REF(TYPE) BOOST_RV_REF(TYPE)
+#define BOOST_THREAD_RV_REF_BEG BOOST_RV_REF_BEG
+#define BOOST_THREAD_RV_REF_END BOOST_RV_REF_END
+#define BOOST_THREAD_RV(V) V
+#define BOOST_THREAD_MAKE_RV_REF(RVALUE) RVALUE
+#define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
+#define BOOST_THREAD_DCL_MOVABLE(TYPE)
+#define BOOST_THREAD_DCL_MOVABLE_BEG(T) \
+ namespace detail { \
+ template <typename T> \
+ struct has_move_emulation_enabled_aux_dummy_specialization<
+
+#define BOOST_THREAD_DCL_MOVABLE_END > \
+ : integral_constant<bool, true> \
+ {}; \
+ }
+
+#elif ! defined BOOST_NO_RVALUE_REFERENCES && defined BOOST_MSVC
+
+#define BOOST_THREAD_RV_REF(TYPE) BOOST_RV_REF(TYPE)
+#define BOOST_THREAD_RV_REF_BEG BOOST_RV_REF_BEG
+#define BOOST_THREAD_RV_REF_END BOOST_RV_REF_END
+#define BOOST_THREAD_RV(V) V
+#define BOOST_THREAD_MAKE_RV_REF(RVALUE) RVALUE
+#define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
+#define BOOST_THREAD_DCL_MOVABLE(TYPE)
+#define BOOST_THREAD_DCL_MOVABLE_BEG(T) \
+ namespace detail { \
+ template <typename T> \
+ struct has_move_emulation_enabled_aux_dummy_specialization<
+
+#define BOOST_THREAD_DCL_MOVABLE_END > \
+ : integral_constant<bool, true> \
+ {}; \
+ }
+
+#else
+
+#if defined BOOST_THREAD_USES_MOVE
+#define BOOST_THREAD_RV_REF(TYPE) BOOST_RV_REF(TYPE)
+#define BOOST_THREAD_RV_REF_BEG BOOST_RV_REF_BEG
+#define BOOST_THREAD_RV_REF_END BOOST_RV_REF_END
+#define BOOST_THREAD_RV(V) V
+#define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
+#define BOOST_THREAD_DCL_MOVABLE(TYPE)
+#define BOOST_THREAD_DCL_MOVABLE_BEG(T) \
+ namespace detail { \
+ template <typename T> \
+ struct has_move_emulation_enabled_aux_dummy_specialization<
+
+#define BOOST_THREAD_DCL_MOVABLE_END > \
+ : integral_constant<bool, true> \
+ {}; \
+ }
+
+#else
+
+#define BOOST_THREAD_RV_REF(TYPE) boost::detail::thread_move_t< TYPE >
+#define BOOST_THREAD_RV_REF_BEG boost::detail::thread_move_t<
+#define BOOST_THREAD_RV_REF_END >
+#define BOOST_THREAD_RV(V) (*V)
+#define BOOST_THREAD_FWD_REF(TYPE) BOOST_FWD_REF(TYPE)
+
+#define BOOST_THREAD_DCL_MOVABLE(TYPE) \
+template <> \
+struct has_move_emulation_enabled_aux< TYPE > \
+ : BOOST_MOVE_BOOST_NS::integral_constant<bool, true> \
+{};
+
+#define BOOST_THREAD_DCL_MOVABLE_BEG(T) \
+template <typename T> \
+struct has_move_emulation_enabled_aux<
+
+#define BOOST_THREAD_DCL_MOVABLE_END > \
+ : BOOST_MOVE_BOOST_NS::integral_constant<bool, true> \
+{};
+
+#endif
+
+namespace boost
+{
+namespace detail
+{
+ template <typename T>
+ BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type)
+ make_rv_ref(T v) BOOST_NOEXCEPT
+ {
+ return (BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type))(v);
+ }
+// template <typename T>
+// BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type)
+// make_rv_ref(T &v) BOOST_NOEXCEPT
+// {
+// return (BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type))(v);
+// }
+// template <typename T>
+// const BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type)
+// make_rv_ref(T const&v) BOOST_NOEXCEPT
+// {
+// return (const BOOST_THREAD_RV_REF(typename ::boost::remove_cv<typename ::boost::remove_reference<T>::type>::type))(v);
+// }
+}
+}
+
+#define BOOST_THREAD_MAKE_RV_REF(RVALUE) RVALUE.move()
+//#define BOOST_THREAD_MAKE_RV_REF(RVALUE) boost::detail::make_rv_ref(RVALUE)
+#endif
+
+
+#if ! defined BOOST_NO_RVALUE_REFERENCES
+
+#define BOOST_THREAD_MOVABLE(TYPE)
+
+#else
+
+#if defined BOOST_THREAD_USES_MOVE
 
+#define BOOST_THREAD_MOVABLE(TYPE) \
+ ::boost::rv<TYPE>& move() BOOST_NOEXCEPT \
+ { \
+ return *static_cast< ::boost::rv<TYPE>* >(this); \
+ } \
+ const ::boost::rv<TYPE>& move() const BOOST_NOEXCEPT \
+ { \
+ return *static_cast<const ::boost::rv<TYPE>* >(this); \
+ } \
+ operator ::boost::rv<TYPE>&() \
+ { \
+ return *static_cast< ::boost::rv<TYPE>* >(this); \
+ } \
+ operator const ::boost::rv<TYPE>&() const \
+ { \
+ return *static_cast<const ::boost::rv<TYPE>* >(this); \
+ }\
+
+#else
+
+#define BOOST_THREAD_MOVABLE(TYPE) \
+ operator ::boost::detail::thread_move_t<TYPE>() BOOST_NOEXCEPT \
+ { \
+ return move(); \
+ } \
+ ::boost::detail::thread_move_t<TYPE> move() BOOST_NOEXCEPT \
+ { \
+ ::boost::detail::thread_move_t<TYPE> x(*this); \
+ return x; \
+ } \
 
+#endif
+#endif
+
+#define BOOST_THREAD_MOVABLE_ONLY(TYPE) \
+ BOOST_THREAD_NO_COPYABLE(TYPE) \
+ BOOST_THREAD_MOVABLE(TYPE) \
+
+#define BOOST_THREAD_COPYABLE_AND_MOVABLE(TYPE) \
+ BOOST_THREAD_MOVABLE(TYPE) \
+
+
+
+#ifndef BOOST_NO_RVALUE_REFERENCES
+namespace boost
+{ namespace thread_detail
+ {
+ template <class T>
+ typename decay<T>::type
+ decay_copy(T&& t)
+ {
+ return boost::forward<T>(t);
+ }
+ }
 }
+#endif
 
 #include <boost/config/abi_suffix.hpp>
 

Modified: branches/release/boost/thread/detail/platform.hpp
==============================================================================
--- branches/release/boost/thread/detail/platform.hpp (original)
+++ branches/release/boost/thread/detail/platform.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -19,6 +19,7 @@
 // choose platform
 #if defined(linux) || defined(__linux) || defined(__linux__)
 # define BOOST_THREAD_LINUX
+# define BOOST_THREAD_WAIT_BUG boost::posix_time::microseconds(100000)
 #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
 # define BOOST_THREAD_BSD
 #elif defined(sun) || defined(__sun)
@@ -35,6 +36,7 @@
 # define BOOST_THREAD_BEOS
 #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
 # define BOOST_THREAD_MACOS
+# define BOOST_THREAD_WAIT_BUG boost::posix_time::microseconds(1000)
 #elif defined(__IBMCPP__) || defined(_AIX)
 # define BOOST_THREAD_AIX
 #elif defined(__amigaos__)
@@ -55,7 +57,7 @@
 // dispatcher table. If there is no entry for a platform but pthreads is
 // available on the platform, pthread is choosen as default. If nothing is
 // available the preprocessor will fail with a diagnostic message.
-
+
 #if defined(BOOST_THREAD_POSIX)
 # define BOOST_THREAD_PLATFORM_PTHREAD
 #else

Modified: branches/release/boost/thread/detail/thread.hpp
==============================================================================
--- branches/release/boost/thread/detail/thread.hpp (original)
+++ branches/release/boost/thread/detail/thread.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -4,7 +4,9 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2007-10 Anthony Williams
+// (C) Copyright 20011-12 Vicente J. Botet Escriba
 
+#include <boost/thread/detail/config.hpp>
 #include <boost/thread/exceptions.hpp>
 #ifndef BOOST_NO_IOSTREAM
 #include <ostream>
@@ -13,7 +15,6 @@
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/xtime.hpp>
 #include <boost/thread/detail/thread_heap_alloc.hpp>
-#include <boost/utility.hpp>
 #include <boost/assert.hpp>
 #include <list>
 #include <algorithm>
@@ -25,6 +26,13 @@
 #include <boost/utility/enable_if.hpp>
 #include <boost/type_traits/remove_reference.hpp>
 #include <boost/io/ios_state.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/decay.hpp>
+#include <boost/functional/hash.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
 
 #include <boost/config/abi_prefix.hpp>
 
@@ -35,6 +43,7 @@
 
 namespace boost
 {
+
     namespace detail
     {
         template<typename F>
@@ -42,18 +51,21 @@
             public detail::thread_data_base
         {
         public:
+ BOOST_THREAD_NO_COPYABLE(thread_data)
 #ifndef BOOST_NO_RVALUE_REFERENCES
- thread_data(F&& f_):
- f(static_cast<F&&>(f_))
- {}
- thread_data(F& f_):
- f(f_)
- {}
+ thread_data(BOOST_THREAD_RV_REF(F) f_):
+ f(boost::forward<F>(f_))
+ {}
+// This overloading must be removed if we want the packaged_task's tests to pass.
+// thread_data(F& f_):
+// f(f_)
+// {}
 #else
- thread_data(F f_):
- f(f_)
+
+ thread_data(BOOST_THREAD_RV_REF(F) f_):
+ f(f_)
             {}
- thread_data(detail::thread_move_t<F> f_):
+ thread_data(F f_):
                 f(f_)
             {}
 #endif
@@ -63,9 +75,6 @@
             }
         private:
             F f;
-
- void operator=(thread_data&);
- thread_data(thread_data&);
         };
 
         template<typename F>
@@ -74,14 +83,11 @@
         {
         private:
             F& f;
-
- void operator=(thread_data&);
- thread_data(thread_data&);
         public:
+ BOOST_THREAD_NO_COPYABLE(thread_data)
             thread_data(boost::reference_wrapper<F> f_):
                 f(f_)
             {}
-
             void run()
             {
                 f();
@@ -94,13 +100,11 @@
         {
         private:
             F& f;
- void operator=(thread_data&);
- thread_data(thread_data&);
         public:
+ BOOST_THREAD_NO_COPYABLE(thread_data)
             thread_data(const boost::reference_wrapper<F> f_):
                 f(f_)
             {}
-
             void run()
             {
                 f();
@@ -110,15 +114,18 @@
 
     class BOOST_THREAD_DECL thread
     {
+ public:
+ typedef thread_attributes attributes;
+
+ BOOST_THREAD_MOVABLE_ONLY(thread)
     private:
- thread(thread&);
- thread& operator=(thread&);
 
         void release_handle();
 
         detail::thread_data_ptr thread_info;
 
         void start_thread();
+ void start_thread(const attributes& attr);
 
         explicit thread(detail::thread_data_ptr data);
 
@@ -126,13 +133,15 @@
 
 #ifndef BOOST_NO_RVALUE_REFERENCES
         template<typename F>
- static inline detail::thread_data_ptr make_thread_info(F&& f)
+ static inline detail::thread_data_ptr make_thread_info(BOOST_THREAD_RV_REF(F) f)
         {
- return detail::thread_data_ptr(detail::heap_new<detail::thread_data<typename boost::remove_reference<F>::type> >(static_cast<F&&>(f)));
+ return detail::thread_data_ptr(detail::heap_new<detail::thread_data<typename boost::remove_reference<F>::type> >(
+ boost::forward<F>(f)));
         }
         static inline detail::thread_data_ptr make_thread_info(void (*f)())
         {
- return detail::thread_data_ptr(detail::heap_new<detail::thread_data<void(*)()> >(static_cast<void(*&&)()>(f)));
+ return detail::thread_data_ptr(detail::heap_new<detail::thread_data<void(*)()> >(
+ boost::forward<void(*)()>(f)));
         }
 #else
         template<typename F>
@@ -141,7 +150,7 @@
             return detail::thread_data_ptr(detail::heap_new<detail::thread_data<F> >(f));
         }
         template<typename F>
- static inline detail::thread_data_ptr make_thread_info(boost::detail::thread_move_t<F> f)
+ static inline detail::thread_data_ptr make_thread_info(BOOST_THREAD_RV_REF(F) f)
         {
             return detail::thread_data_ptr(detail::heap_new<detail::thread_data<F> >(f));
         }
@@ -149,44 +158,40 @@
 #endif
         struct dummy;
     public:
+#if 0 // This should not be needed anymore. Use instead BOOST_THREAD_MAKE_RV_REF.
 #if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
         thread(const volatile thread&);
 #endif
- thread();
- ~thread();
-
-#ifndef BOOST_NO_RVALUE_REFERENCES
-#ifdef BOOST_MSVC
- template <class F>
- explicit thread(F f,typename disable_if<boost::is_convertible<F&,detail::thread_move_t<F> >, dummy* >::type=0):
- thread_info(make_thread_info(static_cast<F&&>(f)))
- {
- start_thread();
- }
-#else
- template <class F>
- thread(F&& f):
- thread_info(make_thread_info(static_cast<F&&>(f)))
- {
- start_thread();
- }
 #endif
-
- thread(thread&& other)
+ thread() BOOST_NOEXCEPT;
+ ~thread()
         {
- thread_info.swap(other.thread_info);
+ #if defined BOOST_THREAD_PROVIDES_THREAD_DESTRUCTOR_CALLS_TERMINATE_IF_JOINABLE
+ if (joinable()) {
+ std::terminate();
+ }
+ #else
+ detach();
+ #endif
         }
-
- thread& operator=(thread&& other)
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ template <
+ class F
+ >
+ explicit thread(BOOST_THREAD_RV_REF(F) f
+ , typename disable_if<is_same<typename decay<F>::type, thread>, dummy* >::type=0
+ ):
+ thread_info(make_thread_info(thread_detail::decay_copy(boost::forward<F>(f))))
         {
- thread_info=other.thread_info;
- other.thread_info.reset();
- return *this;
+ start_thread();
         }
-
- thread&& move()
+ template <
+ class F
+ >
+ thread(attributes& attrs, BOOST_THREAD_RV_REF(F) f):
+ thread_info(make_thread_info(thread_detail::decay_copy(boost::forward<F>(f))))
         {
- return static_cast<thread&&>(*this);
+ start_thread(attrs);
         }
 
 #else
@@ -197,57 +202,73 @@
         {
             start_thread();
         }
+ template <class F>
+ thread(attributes& attrs, F f):
+ thread_info(make_thread_info(f))
+ {
+ start_thread(attrs);
+ }
 #else
         template <class F>
- explicit thread(F f,typename disable_if<boost::is_convertible<F&,detail::thread_move_t<F> >, dummy* >::type=0):
+ explicit thread(F f
+ // todo Disable also if Or is_same<typename decay<F>::type, thread>
+ , typename disable_if<boost::is_convertible<F&,BOOST_THREAD_RV_REF(F) >, dummy* >::type=0):
             thread_info(make_thread_info(f))
         {
             start_thread();
         }
+ template <class F>
+ thread(attributes& attrs, F f
+ , typename disable_if<boost::is_convertible<F&,BOOST_THREAD_RV_REF(F) >, dummy* >::type=0):
+ thread_info(make_thread_info(f))
+ {
+ start_thread(attrs);
+ }
 #endif
-
         template <class F>
- explicit thread(detail::thread_move_t<F> f):
+ explicit thread(BOOST_THREAD_RV_REF(F) f
+ , typename disable_if<is_same<typename decay<F>::type, thread>, dummy* >::type=0
+ ):
             thread_info(make_thread_info(f))
         {
             start_thread();
         }
 
- thread(detail::thread_move_t<thread> x)
+ template <class F>
+ thread(attributes& attrs, BOOST_THREAD_RV_REF(F) f):
+ thread_info(make_thread_info(f))
         {
- thread_info=x->thread_info;
- x->thread_info.reset();
+ start_thread(attrs);
         }
-
+#endif
+ thread(BOOST_THREAD_RV_REF(thread) x)
+ {
+ thread_info=BOOST_THREAD_RV(x).thread_info;
+ BOOST_THREAD_RV(x).thread_info.reset();
+ }
+#if 0 // This should not be needed anymore. Use instead BOOST_THREAD_MAKE_RV_REF.
 #if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
         thread& operator=(thread x)
         {
             swap(x);
             return *this;
         }
-#else
- thread& operator=(detail::thread_move_t<thread> x)
- {
- thread new_thread(x);
- swap(new_thread);
- return *this;
- }
 #endif
- operator detail::thread_move_t<thread>()
- {
- return move();
- }
+#endif
 
- detail::thread_move_t<thread> move()
+ thread& operator=(BOOST_THREAD_RV_REF(thread) other) BOOST_NOEXCEPT
         {
- detail::thread_move_t<thread> x(*this);
- return x;
- }
 
+#if defined BOOST_THREAD_PROVIDES_THREAD_MOVE_ASSIGN_CALLS_TERMINATE_IF_JOINABLE
+ if (joinable()) std::terminate();
 #endif
+ thread_info=BOOST_THREAD_RV(other).thread_info;
+ BOOST_THREAD_RV(other).thread_info.reset();
+ return *this;
+ }
 
         template <class F,class A1>
- thread(F f,A1 a1):
+ thread(F f,A1 a1,typename disable_if<boost::is_convertible<F&,thread_attributes >, dummy* >::type=0):
             thread_info(make_thread_info(boost::bind(boost::type<void>(),f,a1)))
         {
             start_thread();
@@ -308,36 +329,92 @@
             start_thread();
         }
 
- void swap(thread& x)
+ void swap(thread& x) BOOST_NOEXCEPT
         {
             thread_info.swap(x.thread_info);
         }
 
         class BOOST_SYMBOL_VISIBLE id;
- id get_id() const;
+ id get_id() const BOOST_NOEXCEPT;
 
 
- bool joinable() const;
+ bool joinable() const BOOST_NOEXCEPT;
         void join();
- bool timed_join(const system_time& wait_until);
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_join_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_join_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_join_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ return try_join_until(s_now + ceil<nanoseconds>(t - c_now));
+ }
+ template <class Duration>
+ bool try_join_until(const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<system_clock, nanoseconds> nano_sys_tmpt;
+ return try_join_until(nano_sys_tmpt(ceil<nanoseconds>(t.time_since_epoch())));
+ }
+#endif
+#if defined(BOOST_THREAD_PLATFORM_WIN32)
+ bool timed_join(const system_time& abs_time);
+
+#ifdef BOOST_THREAD_USES_CHRONO
+ bool try_join_until(const chrono::time_point<chrono::system_clock, chrono::nanoseconds>& tp);
+#endif
+ public:
+
+#else
+ bool timed_join(const system_time& abs_time)
+ {
+ struct timespec const ts=detail::get_timespec(abs_time);
+ return do_try_join_until(ts);
+ }
+#ifdef BOOST_THREAD_USES_CHRONO
+ bool try_join_until(const chrono::time_point<chrono::system_clock, chrono::nanoseconds>& tp)
+ {
+ using namespace chrono;
+ nanoseconds d = tp.time_since_epoch();
+ timespec ts;
+ seconds s = duration_cast<seconds>(d);
+ ts.tv_sec = static_cast<long>(s.count());
+ ts.tv_nsec = static_cast<long>((d - s).count());
+ return do_try_join_until(ts);
+ }
+#endif
+ private:
+ bool do_try_join_until(struct timespec const &timeout);
+ public:
+
+#endif
 
         template<typename TimeDuration>
         inline bool timed_join(TimeDuration const& rel_time)
         {
             return timed_join(get_system_time()+rel_time);
         }
- void detach();
 
- static unsigned hardware_concurrency();
+ void detach() BOOST_NOEXCEPT;
 
+ static unsigned hardware_concurrency() BOOST_NOEXCEPT;
+
+#define BOOST_THREAD_DEFINES_THREAD_NATIVE_HANDLE
         typedef detail::thread_data_base::native_handle_type native_handle_type;
         native_handle_type native_handle();
 
+#if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
+ // Use thread::id when comparisions are needed
         // backwards compatibility
         bool operator==(const thread& other) const;
         bool operator!=(const thread& other) const;
-
- static inline void yield()
+#endif
+ static inline void yield() BOOST_NOEXCEPT
         {
             this_thread::yield();
         }
@@ -349,37 +426,30 @@
 
         // extensions
         void interrupt();
- bool interruption_requested() const;
+ bool interruption_requested() const BOOST_NOEXCEPT;
     };
 
- inline void swap(thread& lhs,thread& rhs)
+ inline void swap(thread& lhs,thread& rhs) BOOST_NOEXCEPT
     {
         return lhs.swap(rhs);
     }
 
 #ifndef BOOST_NO_RVALUE_REFERENCES
- inline thread&& move(thread& t)
+ inline thread&& move(thread& t) BOOST_NOEXCEPT
     {
         return static_cast<thread&&>(t);
     }
- inline thread&& move(thread&& t)
- {
- return static_cast<thread&&>(t);
- }
-#else
- inline detail::thread_move_t<thread> move(detail::thread_move_t<thread> t)
- {
- return t;
- }
 #endif
 
+ BOOST_THREAD_DCL_MOVABLE(thread)
+
     namespace this_thread
     {
- thread::id BOOST_THREAD_DECL get_id();
+ thread::id BOOST_THREAD_DECL get_id() BOOST_NOEXCEPT;
 
         void BOOST_THREAD_DECL interruption_point();
- bool BOOST_THREAD_DECL interruption_enabled();
- bool BOOST_THREAD_DECL interruption_requested();
+ bool BOOST_THREAD_DECL interruption_enabled() BOOST_NOEXCEPT;
+ bool BOOST_THREAD_DECL interruption_requested() BOOST_NOEXCEPT;
 
         inline BOOST_SYMBOL_VISIBLE void sleep(xtime const& abs_time)
         {
@@ -390,48 +460,76 @@
     class BOOST_SYMBOL_VISIBLE thread::id
     {
     private:
- detail::thread_data_ptr thread_data;
+ friend inline
+ std::size_t
+ hash_value(const thread::id &v)
+ {
+#if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
+ return hash_value(v.thread_data);
+#else
+ return hash_value(v.thread_data.get());
+#endif
+ }
+
+#if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
+#if defined(BOOST_THREAD_PLATFORM_WIN32)
+ typedef unsigned int data;
+#else
+ typedef thread::native_handle_type data;
+#endif
+#else
+ typedef detail::thread_data_ptr data;
+#endif
+ data thread_data;
 
- id(detail::thread_data_ptr thread_data_):
+ id(data thread_data_):
             thread_data(thread_data_)
         {}
         friend class thread;
- friend id BOOST_THREAD_DECL this_thread::get_id();
+ friend id BOOST_THREAD_DECL this_thread::get_id() BOOST_NOEXCEPT;
     public:
- id():
- thread_data()
+ id() BOOST_NOEXCEPT:
+#if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
+#if defined(BOOST_THREAD_PLATFORM_WIN32)
+ thread_data(0)
+#else
+ thread_data(0)
+#endif
+#else
+ thread_data()
+#endif
         {}
 
- id(const id& other):
+ id(const id& other) BOOST_NOEXCEPT :
             thread_data(other.thread_data)
         {}
 
- bool operator==(const id& y) const
+ bool operator==(const id& y) const BOOST_NOEXCEPT
         {
             return thread_data==y.thread_data;
         }
 
- bool operator!=(const id& y) const
+ bool operator!=(const id& y) const BOOST_NOEXCEPT
         {
             return thread_data!=y.thread_data;
         }
 
- bool operator<(const id& y) const
+ bool operator<(const id& y) const BOOST_NOEXCEPT
         {
             return thread_data<y.thread_data;
         }
 
- bool operator>(const id& y) const
+ bool operator>(const id& y) const BOOST_NOEXCEPT
         {
             return y.thread_data<thread_data;
         }
 
- bool operator<=(const id& y) const
+ bool operator<=(const id& y) const BOOST_NOEXCEPT
         {
             return !(y.thread_data<thread_data);
         }
 
- bool operator>=(const id& y) const
+ bool operator>=(const id& y) const BOOST_NOEXCEPT
         {
             return !(thread_data<y.thread_data);
         }
@@ -440,7 +538,7 @@
 #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
         template<class charT, class traits>
         friend BOOST_SYMBOL_VISIBLE
- std::basic_ostream<charT, traits>&
+ std::basic_ostream<charT, traits>&
         operator<<(std::basic_ostream<charT, traits>& os, const id& x)
         {
             if(x.thread_data)
@@ -456,12 +554,13 @@
 #else
         template<class charT, class traits>
         BOOST_SYMBOL_VISIBLE
- std::basic_ostream<charT, traits>&
+ std::basic_ostream<charT, traits>&
         print(std::basic_ostream<charT, traits>& os) const
         {
             if(thread_data)
             {
- return os<<thread_data;
+ io::ios_flags_saver ifs( os );
+ return os<< std::hex << thread_data;
             }
             else
             {
@@ -521,13 +620,6 @@
         void BOOST_THREAD_DECL add_thread_exit_function(thread_exit_function_base*);
     }
 
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <>
- struct has_move_emulation_enabled_aux<thread>
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
-#endif
-
     namespace this_thread
     {
         template<typename F>

Modified: branches/release/boost/thread/detail/thread_interruption.hpp
==============================================================================
--- branches/release/boost/thread/detail/thread_interruption.hpp (original)
+++ branches/release/boost/thread/detail/thread_interruption.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -4,6 +4,10 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2007-9 Anthony Williams
+// (C) Copyright 2012 Vicente J. Botet Escriba
+
+#include <boost/thread/detail/config.hpp>
+#include <boost/thread/detail/delete.hpp>
 
 namespace boost
 {
@@ -11,23 +15,20 @@
     {
         class BOOST_THREAD_DECL disable_interruption
         {
- disable_interruption(const disable_interruption&);
- disable_interruption& operator=(const disable_interruption&);
-
- bool interruption_was_enabled;
- friend class restore_interruption;
+ bool interruption_was_enabled;
+ friend class restore_interruption;
         public:
- disable_interruption();
- ~disable_interruption();
+ BOOST_THREAD_NO_COPYABLE(disable_interruption)
+ disable_interruption() BOOST_NOEXCEPT;
+ ~disable_interruption() BOOST_NOEXCEPT;
         };
 
         class BOOST_THREAD_DECL restore_interruption
         {
- restore_interruption(const restore_interruption&);
- restore_interruption& operator=(const restore_interruption&);
         public:
- explicit restore_interruption(disable_interruption& d);
- ~restore_interruption();
+ BOOST_THREAD_NO_COPYABLE(restore_interruption)
+ explicit restore_interruption(disable_interruption& d) BOOST_NOEXCEPT;
+ ~restore_interruption() BOOST_NOEXCEPT;
         };
     }
 }

Modified: branches/release/boost/thread/exceptions.hpp
==============================================================================
--- branches/release/boost/thread/exceptions.hpp (original)
+++ branches/release/boost/thread/exceptions.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,8 +1,9 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
 // Copyright (C) 2007-9 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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)
 
 #ifndef BOOST_THREAD_EXCEPTIONS_PDM070801_H
@@ -18,6 +19,9 @@
 
 #include <string>
 #include <stdexcept>
+#include <boost/system/system_error.hpp>
+#include <boost/system/error_code.hpp>
+
 
 #include <boost/config/abi_prefix.hpp>
 
@@ -28,151 +32,188 @@
     {};
 
     class BOOST_SYMBOL_VISIBLE thread_exception:
- public std::exception
+ public system::system_error
+ //public std::exception
     {
- protected:
- thread_exception():
- m_sys_err(0)
+ typedef system::system_error base_type;
+ public:
+ thread_exception()
+ : base_type(0,system::system_category())
         {}
-
- thread_exception(int sys_err_code):
- m_sys_err(sys_err_code)
+
+ thread_exception(int sys_error_code)
+ : base_type(sys_error_code, system::system_category())
         {}
-
 
- public:
+ thread_exception( int ev, const char * what_arg )
+ : base_type(system::error_code(ev, system::system_category()), what_arg)
+ {
+ }
+ thread_exception( int ev, const std::string & what_arg )
+ : base_type(system::error_code(ev, system::system_category()), what_arg)
+ {
+ }
+
         ~thread_exception() throw()
         {}
-
+
 
         int native_error() const
         {
- return m_sys_err;
+ return code().value();
         }
-
 
- private:
- int m_sys_err;
     };
 
     class BOOST_SYMBOL_VISIBLE condition_error:
- public std::exception
+ public system::system_error
+ //public std::exception
     {
+ typedef system::system_error base_type;
     public:
- const char* what() const throw()
- {
- return "Condition error";
- }
+ condition_error()
+ : base_type(system::error_code(0, system::system_category()), "Condition error")
+ {}
+ condition_error( int ev )
+ : base_type(system::error_code(ev, system::system_category()), "Condition error")
+ {
+ }
+ condition_error( int ev, const char * what_arg )
+ : base_type(system::error_code(ev, system::system_category()), what_arg)
+ {
+ }
+ condition_error( int ev, const std::string & what_arg )
+ : base_type(system::error_code(ev, system::system_category()), what_arg)
+ {
+ }
     };
-
+
 
     class BOOST_SYMBOL_VISIBLE lock_error:
         public thread_exception
     {
+ typedef thread_exception base_type;
     public:
         lock_error()
+ : base_type(0, "boost::lock_error")
         {}
-
- lock_error(int sys_err_code):
- thread_exception(sys_err_code)
- {}
-
- ~lock_error() throw()
- {}
-
 
- virtual const char* what() const throw()
+ lock_error( int ev )
+ : base_type(ev, "boost::lock_error")
+ {
+ }
+ lock_error( int ev, const char * what_arg )
+ : base_type(ev, what_arg)
         {
- return "boost::lock_error";
         }
+ lock_error( int ev, const std::string & what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
+
+ ~lock_error() throw()
+ {}
+
     };
 
     class BOOST_SYMBOL_VISIBLE thread_resource_error:
         public thread_exception
     {
+ typedef thread_exception base_type;
     public:
- thread_resource_error()
- {}
-
- thread_resource_error(int sys_err_code):
- thread_exception(sys_err_code)
- {}
-
+ thread_resource_error()
+ : base_type(system::errc::resource_unavailable_try_again, "boost::thread_resource_error")
+ {}
+
+ thread_resource_error( int ev )
+ : base_type(ev, "boost::thread_resource_error")
+ {
+ }
+ thread_resource_error( int ev, const char * what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
+ thread_resource_error( int ev, const std::string & what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
+
+
         ~thread_resource_error() throw()
         {}
-
 
- virtual const char* what() const throw()
- {
- return "boost::thread_resource_error";
- }
-
     };
 
     class BOOST_SYMBOL_VISIBLE unsupported_thread_option:
         public thread_exception
     {
+ typedef thread_exception base_type;
     public:
- unsupported_thread_option()
- {}
-
- unsupported_thread_option(int sys_err_code):
- thread_exception(sys_err_code)
- {}
-
- ~unsupported_thread_option() throw()
- {}
-
+ unsupported_thread_option()
+ : base_type(system::errc::invalid_argument, "boost::unsupported_thread_option")
+ {}
+
+ unsupported_thread_option( int ev )
+ : base_type(ev, "boost::unsupported_thread_option")
+ {
+ }
+ unsupported_thread_option( int ev, const char * what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
+ unsupported_thread_option( int ev, const std::string & what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
 
- virtual const char* what() const throw()
- {
- return "boost::unsupported_thread_option";
- }
-
     };
 
     class BOOST_SYMBOL_VISIBLE invalid_thread_argument:
         public thread_exception
     {
+ typedef thread_exception base_type;
     public:
         invalid_thread_argument()
+ : base_type(system::errc::invalid_argument, "boost::invalid_thread_argument")
         {}
-
- invalid_thread_argument(int sys_err_code):
- thread_exception(sys_err_code)
- {}
-
- ~invalid_thread_argument() throw()
- {}
-
 
- virtual const char* what() const throw()
+ invalid_thread_argument( int ev )
+ : base_type(ev, "boost::invalid_thread_argument")
+ {
+ }
+ invalid_thread_argument( int ev, const char * what_arg )
+ : base_type(ev, what_arg)
         {
- return "boost::invalid_thread_argument";
         }
-
+ invalid_thread_argument( int ev, const std::string & what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
+
     };
 
     class BOOST_SYMBOL_VISIBLE thread_permission_error:
         public thread_exception
     {
+ typedef thread_exception base_type;
     public:
- thread_permission_error()
- {}
-
- thread_permission_error(int sys_err_code):
- thread_exception(sys_err_code)
- {}
-
- ~thread_permission_error() throw()
- {}
-
+ thread_permission_error()
+ : base_type(system::errc::permission_denied, "boost::thread_permission_error")
+ {}
+
+ thread_permission_error( int ev )
+ : base_type(ev, "boost::thread_permission_error")
+ {
+ }
+ thread_permission_error( int ev, const char * what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
+ thread_permission_error( int ev, const std::string & what_arg )
+ : base_type(ev, what_arg)
+ {
+ }
 
- virtual const char* what() const throw()
- {
- return "boost::thread_permission_error";
- }
-
     };
 
 } // namespace boost

Modified: branches/release/boost/thread/future.hpp
==============================================================================
--- branches/release/boost/thread/future.hpp (original)
+++ branches/release/boost/thread/future.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,4 +1,5 @@
 // (C) Copyright 2008-10 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -6,6 +7,9 @@
 
 #ifndef BOOST_THREAD_FUTURE_HPP
 #define BOOST_THREAD_FUTURE_HPP
+
+#include <boost/thread/detail/config.hpp>
+#include <boost/detail/scoped_enum_emulation.hpp>
 #include <stdexcept>
 #include <boost/thread/detail/move.hpp>
 #include <boost/thread/thread_time.hpp>
@@ -16,6 +20,8 @@
 #include <boost/scoped_ptr.hpp>
 #include <boost/type_traits/is_fundamental.hpp>
 #include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/type_traits/remove_cv.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/config.hpp>
 #include <boost/throw_exception.hpp>
@@ -28,59 +34,164 @@
 #include <list>
 #include <boost/next_prior.hpp>
 #include <vector>
+#include <boost/system/error_code.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#endif
+
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+#include <boost/thread/detail/memory.hpp>
+#endif
+
+#if defined BOOST_THREAD_PROVIDES_FUTURE
+#define BOOST_THREAD_FUTURE future
+#else
+#define BOOST_THREAD_FUTURE unique_future
+#endif
 
 namespace boost
 {
- class future_uninitialized:
- public std::logic_error
+
+ //enum class future_errc
+ BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_errc)
+ {
+ broken_promise,
+ future_already_retrieved,
+ promise_already_satisfied,
+ no_state
+ }
+ BOOST_SCOPED_ENUM_DECLARE_END(future_errc)
+
+ namespace system
+ {
+ template <>
+ struct BOOST_SYMBOL_VISIBLE is_error_code_enum<future_errc> : public true_type {};
+
+ #ifdef BOOST_NO_SCOPED_ENUMS
+ template <>
+ struct BOOST_SYMBOL_VISIBLE is_error_code_enum<future_errc::enum_type> : public true_type { };
+ #endif
+ }
+
+ //enum class launch
+ BOOST_SCOPED_ENUM_DECLARE_BEGIN(launch)
+ {
+ async = 1,
+ deferred = 2,
+ any = async | deferred
+ }
+ BOOST_SCOPED_ENUM_DECLARE_END(launch)
+
+ //enum class future_status
+ BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_status)
+ {
+ ready,
+ timeout,
+ deferred
+ }
+ BOOST_SCOPED_ENUM_DECLARE_END(future_status)
+
+ BOOST_THREAD_DECL
+ const system::error_category& future_category();
+
+ namespace system
+ {
+ inline BOOST_THREAD_DECL
+ error_code
+ make_error_code(future_errc e)
+ {
+ return error_code(underlying_cast<int>(e), boost::future_category());
+ }
+
+ inline BOOST_THREAD_DECL
+ error_condition
+ make_error_condition(future_errc e)
+ {
+ return error_condition(underlying_cast<int>(e), future_category());
+ }
+ }
+
+ class BOOST_SYMBOL_VISIBLE future_error
+ : public std::logic_error
+ {
+ system::error_code ec_;
+ public:
+ future_error(system::error_code ec)
+ : logic_error(ec.message()),
+ ec_(ec)
+ {
+ }
+
+ const system::error_code& code() const BOOST_NOEXCEPT
+ {
+ return ec_;
+ }
+
+ //virtual ~future_error() BOOST_NOEXCEPT;
+ };
+
+ class BOOST_SYMBOL_VISIBLE future_uninitialized:
+ public future_error
     {
     public:
         future_uninitialized():
- std::logic_error("Future Uninitialized")
+ future_error(system::make_error_code(future_errc::no_state))
         {}
     };
- class broken_promise:
- public std::logic_error
+ class BOOST_SYMBOL_VISIBLE broken_promise:
+ public future_error
     {
     public:
         broken_promise():
- std::logic_error("Broken promise")
+ future_error(system::make_error_code(future_errc::broken_promise))
         {}
     };
- class future_already_retrieved:
- public std::logic_error
+ class BOOST_SYMBOL_VISIBLE future_already_retrieved:
+ public future_error
     {
     public:
         future_already_retrieved():
- std::logic_error("Future already retrieved")
+ future_error(system::make_error_code(future_errc::future_already_retrieved))
         {}
     };
- class promise_already_satisfied:
- public std::logic_error
+ class BOOST_SYMBOL_VISIBLE promise_already_satisfied:
+ public future_error
     {
     public:
         promise_already_satisfied():
- std::logic_error("Promise already satisfied")
+ future_error(system::make_error_code(future_errc::promise_already_satisfied))
         {}
     };
 
- class task_already_started:
- public std::logic_error
+ class BOOST_SYMBOL_VISIBLE task_already_started:
+ public future_error
     {
     public:
         task_already_started():
- std::logic_error("Task already started")
+ future_error(system::make_error_code(future_errc::promise_already_satisfied))
+ //std::logic_error("Task already started")
         {}
     };
 
- class task_moved:
- public std::logic_error
- {
- public:
- task_moved():
- std::logic_error("Task moved")
- {}
- };
+ class BOOST_SYMBOL_VISIBLE task_moved:
+ public future_error
+ {
+ public:
+ task_moved():
+ future_error(system::make_error_code(future_errc::no_state))
+ //std::logic_error("Task moved")
+ {}
+ };
+
+ class promise_moved:
+ public future_error
+ {
+ public:
+ promise_moved():
+ future_error(system::make_error_code(future_errc::no_state))
+ //std::logic_error("Promise moved")
+ {}
+ };
 
     namespace future_state
     {
@@ -93,6 +204,7 @@
         {
             boost::exception_ptr exception;
             bool done;
+ bool thread_was_interrupted;
             boost::mutex mutex;
             boost::condition_variable waiters;
             typedef std::list<boost::condition_variable_any*> waiter_list;
@@ -100,7 +212,8 @@
             boost::function<void()> callback;
 
             future_object_base():
- done(false)
+ done(false),
+ thread_was_interrupted(false)
             {}
             virtual ~future_object_base()
             {}
@@ -165,6 +278,10 @@
                 {
                     waiters.wait(lock);
                 }
+ if(rethrow && thread_was_interrupted)
+ {
+ throw boost::thread_interrupted();
+ }
                 if(rethrow && exception)
                 {
                     boost::rethrow_exception(exception);
@@ -186,6 +303,25 @@
                 return true;
             }
 
+#ifdef BOOST_THREAD_USES_CHRONO
+
+ template <class Clock, class Duration>
+ future_status
+ wait_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::unique_lock<boost::mutex> lock(mutex);
+ do_callback(lock);
+ while(!done)
+ {
+ cv_status const st=waiters.wait_until(lock,abs_time);
+ if(st==cv_status::timeout && !done)
+ {
+ return future_status::timeout;
+ }
+ }
+ return future_status::ready;
+ }
+#endif
             void mark_exceptional_finish_internal(boost::exception_ptr const& e)
             {
                 exception=e;
@@ -196,16 +332,21 @@
                 boost::lock_guard<boost::mutex> lock(mutex);
                 mark_exceptional_finish_internal(boost::current_exception());
             }
-
+ void mark_interrupted_finish()
+ {
+ boost::lock_guard<boost::mutex> lock(mutex);
+ thread_was_interrupted=true;
+ mark_finished_internal();
+ }
             bool has_value()
             {
                 boost::lock_guard<boost::mutex> lock(mutex);
- return done && !exception;
+ return done && !(exception || thread_was_interrupted);
             }
             bool has_exception()
             {
                 boost::lock_guard<boost::mutex> lock(mutex);
- return done && exception;
+ return done && (exception || thread_was_interrupted);
             }
 
             template<typename F,typename U>
@@ -226,14 +367,20 @@
 #ifndef BOOST_NO_RVALUE_REFERENCES
             typedef T const& source_reference_type;
             struct dummy;
- typedef typename boost::mpl::if_<boost::is_fundamental<T>,dummy&,T&&>::type rvalue_source_type;
- typedef typename boost::mpl::if_<boost::is_fundamental<T>,T,T&&>::type move_dest_type;
+ typedef typename boost::mpl::if_<boost::is_fundamental<T>,dummy&,BOOST_THREAD_RV_REF(T)>::type rvalue_source_type;
+ typedef typename boost::mpl::if_<boost::is_fundamental<T>,T,BOOST_THREAD_RV_REF(T)>::type move_dest_type;
+#elif defined BOOST_THREAD_USES_MOVE
+ typedef T& source_reference_type;
+ typedef typename boost::mpl::if_<boost::has_move_emulation_enabled<T>,BOOST_THREAD_RV_REF(T),T const&>::type rvalue_source_type;
+ typedef typename boost::mpl::if_<boost::has_move_emulation_enabled<T>,BOOST_THREAD_RV_REF(T),T>::type move_dest_type;
 #else
             typedef T& source_reference_type;
- typedef typename boost::mpl::if_<boost::is_convertible<T&,boost::detail::thread_move_t<T> >,boost::detail::thread_move_t<T>,T const&>::type rvalue_source_type;
- typedef typename boost::mpl::if_<boost::is_convertible<T&,boost::detail::thread_move_t<T> >,boost::detail::thread_move_t<T>,T>::type move_dest_type;
+ typedef typename boost::mpl::if_<boost::is_convertible<T&,BOOST_THREAD_RV_REF(T) >,BOOST_THREAD_RV_REF(T),T const&>::type rvalue_source_type;
+ typedef typename boost::mpl::if_<boost::is_convertible<T&,BOOST_THREAD_RV_REF(T) >,BOOST_THREAD_RV_REF(T),T>::type move_dest_type;
 #endif
 
+ typedef const T& shared_future_get_result_type;
+
             static void init(storage_type& storage,source_reference_type t)
             {
                 storage.reset(new T(t));
@@ -241,7 +388,7 @@
 
             static void init(storage_type& storage,rvalue_source_type t)
             {
- storage.reset(new T(static_cast<rvalue_source_type>(t)));
+ storage.reset(new T(static_cast<rvalue_source_type>(t)));
             }
 
             static void cleanup(storage_type& storage)
@@ -258,6 +405,7 @@
             struct rvalue_source_type
             {};
             typedef T& move_dest_type;
+ typedef T& shared_future_get_result_type;
 
             static void init(storage_type& storage,T& t)
             {
@@ -275,6 +423,7 @@
         {
             typedef bool storage_type;
             typedef void move_dest_type;
+ typedef void shared_future_get_result_type;
 
             static void init(storage_type& storage)
             {
@@ -296,6 +445,7 @@
             typedef typename future_traits<T>::source_reference_type source_reference_type;
             typedef typename future_traits<T>::rvalue_source_type rvalue_source_type;
             typedef typename future_traits<T>::move_dest_type move_dest_type;
+ typedef typename future_traits<T>::shared_future_get_result_type shared_future_get_result_type;
 
             storage_type result;
 
@@ -308,6 +458,7 @@
                 future_traits<T>::init(result,result_);
                 mark_finished_internal();
             }
+
             void mark_finished_with_result_internal(rvalue_source_type result_)
             {
                 future_traits<T>::init(result,static_cast<rvalue_source_type>(result_));
@@ -319,6 +470,7 @@
                 boost::lock_guard<boost::mutex> lock(mutex);
                 mark_finished_with_result_internal(result_);
             }
+
             void mark_finished_with_result(rvalue_source_type result_)
             {
                 boost::lock_guard<boost::mutex> lock(mutex);
@@ -331,6 +483,12 @@
                 return static_cast<move_dest_type>(*result);
             }
 
+ shared_future_get_result_type get_sh()
+ {
+ wait();
+ return static_cast<shared_future_get_result_type>(*result);
+ }
+
             future_state::state get_state()
             {
                 boost::lock_guard<boost::mutex> guard(mutex);
@@ -353,7 +511,7 @@
         struct future_object<void>:
             detail::future_object_base
         {
- typedef void move_dest_type;
+ typedef void shared_future_get_result_type;
 
             future_object()
             {}
@@ -373,7 +531,10 @@
             {
                 wait();
             }
-
+ void get_sh()
+ {
+ wait();
+ }
             future_state::state get_state()
             {
                 boost::lock_guard<boost::mutex> guard(mutex);
@@ -386,12 +547,22 @@
                     return future_state::ready;
                 }
             }
-
         private:
             future_object(future_object const&);
             future_object& operator=(future_object const&);
         };
 
+// template<typename T, typename Allocator>
+// struct future_object_alloc: public future_object<T>
+// {
+// typedef future_object<T> base;
+// Allocator alloc_;
+//
+// public:
+// explicit future_object_alloc(const Allocator& a)
+// : alloc_(a) {}
+//
+// };
         class future_waiter
         {
             struct registered_waiter;
@@ -399,38 +570,32 @@
 
             struct registered_waiter
             {
- boost::shared_ptr<detail::future_object_base> future;
+ boost::shared_ptr<detail::future_object_base> future_;
                 detail::future_object_base::waiter_list::iterator wait_iterator;
                 count_type index;
 
- registered_waiter(boost::shared_ptr<detail::future_object_base> const& future_,
+ registered_waiter(boost::shared_ptr<detail::future_object_base> const& a_future,
                                   detail::future_object_base::waiter_list::iterator wait_iterator_,
                                   count_type index_):
- future(future_),wait_iterator(wait_iterator_),index(index_)
+ future_(a_future),wait_iterator(wait_iterator_),index(index_)
                 {}
 
             };
 
             struct all_futures_lock
             {
-#ifdef _MANAGED
- typedef std::ptrdiff_t count_type_portable;
-#else
- typedef count_type count_type_portable;
-#endif
- count_type_portable count;
-
+ count_type count;
                 boost::scoped_array<boost::unique_lock<boost::mutex> > locks;
 
                 all_futures_lock(std::vector<registered_waiter>& futures):
                     count(futures.size()),locks(new boost::unique_lock<boost::mutex>[count])
                 {
- for(count_type_portable i=0;i<count;++i)
+ for(count_type i=0;i<count;++i)
                     {
 #if defined __DECCXX || defined __SUNPRO_CC
- locks[i]=boost::unique_lock<boost::mutex>(futures[i].future->mutex).move();
+ locks[i]=boost::unique_lock<boost::mutex>(futures[i].future_->mutex).move();
 #else
- locks[i]=boost::unique_lock<boost::mutex>(futures[i].future->mutex);
+ locks[i]=boost::unique_lock<boost::mutex>(futures[i].future_->mutex);
 #endif
                     }
                 }
@@ -442,7 +607,7 @@
 
                 void unlock()
                 {
- for(count_type_portable i=0;i<count;++i)
+ for(count_type i=0;i<count;++i)
                     {
                         locks[i].unlock();
                     }
@@ -461,9 +626,9 @@
             template<typename F>
             void add(F& f)
             {
- if(f.future)
+ if(f.future_)
                 {
- futures.push_back(registered_waiter(f.future,f.future->register_external_waiter(cv),future_count));
+ futures.push_back(registered_waiter(f.future_,f.future_->register_external_waiter(cv),future_count));
                 }
                 ++future_count;
             }
@@ -475,7 +640,7 @@
                 {
                     for(count_type i=0;i<futures.size();++i)
                     {
- if(futures[i].future->done)
+ if(futures[i].future_->done)
                         {
                             return futures[i].index;
                         }
@@ -488,7 +653,7 @@
             {
                 for(count_type i=0;i<futures.size();++i)
                 {
- futures[i].future->remove_external_waiter(futures[i].wait_iterator);
+ futures[i].future_->remove_external_waiter(futures[i].wait_iterator);
                 }
             }
 
@@ -497,7 +662,7 @@
     }
 
     template <typename R>
- class unique_future;
+ class BOOST_THREAD_FUTURE;
 
     template <typename R>
     class shared_future;
@@ -509,7 +674,7 @@
     };
 
     template<typename T>
- struct is_future_type<unique_future<T> >
+ struct is_future_type<BOOST_THREAD_FUTURE<T> >
     {
         BOOST_STATIC_CONSTANT(bool, value=true);
     };
@@ -626,14 +791,13 @@
     class packaged_task;
 
     template <typename R>
- class unique_future
+ class BOOST_THREAD_FUTURE
     {
- unique_future(unique_future & rhs);// = delete;
- unique_future& operator=(unique_future& rhs);// = delete;
+ private:
 
         typedef boost::shared_ptr<detail::future_object<R> > future_ptr;
 
- future_ptr future;
+ future_ptr future_;
 
         friend class shared_future<R>;
         friend class promise<R>;
@@ -642,99 +806,92 @@
 
         typedef typename detail::future_traits<R>::move_dest_type move_dest_type;
 
- unique_future(future_ptr future_):
- future(future_)
+ BOOST_THREAD_FUTURE(future_ptr a_future):
+ future_(a_future)
         {}
 
     public:
+ BOOST_THREAD_MOVABLE_ONLY(BOOST_THREAD_FUTURE)
         typedef future_state::state state;
 
- unique_future()
+ BOOST_THREAD_FUTURE()
         {}
 
- ~unique_future()
+ ~BOOST_THREAD_FUTURE()
         {}
 
-#ifndef BOOST_NO_RVALUE_REFERENCES
- unique_future(unique_future && other)
- {
- future.swap(other.future);
- }
- unique_future& operator=(unique_future && other)
- {
- future=other.future;
- other.future.reset();
- return *this;
- }
-#else
- unique_future(boost::detail::thread_move_t<unique_future> other):
- future(other->future)
+ BOOST_THREAD_FUTURE(BOOST_THREAD_RV_REF(BOOST_THREAD_FUTURE) other) BOOST_NOEXCEPT:
+ future_(BOOST_THREAD_RV(other).future_)
         {
- other->future.reset();
+ BOOST_THREAD_RV(other).future_.reset();
         }
 
- unique_future& operator=(boost::detail::thread_move_t<unique_future> other)
+ BOOST_THREAD_FUTURE& operator=(BOOST_THREAD_RV_REF(BOOST_THREAD_FUTURE) other) BOOST_NOEXCEPT
         {
- future=other->future;
- other->future.reset();
+ future_=BOOST_THREAD_RV(other).future_;
+ BOOST_THREAD_RV(other).future_.reset();
             return *this;
         }
 
- operator boost::detail::thread_move_t<unique_future>()
+ shared_future<R> share()
         {
- return boost::detail::thread_move_t<unique_future>(*this);
+ return shared_future<R>(::boost::move(*this));
         }
-#endif
 
- void swap(unique_future& other)
+ void swap(BOOST_THREAD_FUTURE& other)
         {
- future.swap(other.future);
+ future_.swap(other.future_);
         }
 
         // retrieving the value
         move_dest_type get()
         {
- if(!future)
+ if(!future_)
             {
                 boost::throw_exception(future_uninitialized());
             }
 
- return future->get();
+ return future_->get();
         }
 
         // functions to check state, and wait for ready
- state get_state() const
+ state get_state() const BOOST_NOEXCEPT
         {
- if(!future)
+ if(!future_)
             {
                 return future_state::uninitialized;
             }
- return future->get_state();
+ return future_->get_state();
         }
 
-
- bool is_ready() const
+ bool is_ready() const BOOST_NOEXCEPT
         {
             return get_state()==future_state::ready;
         }
 
- bool has_exception() const
+ bool has_exception() const BOOST_NOEXCEPT
         {
- return future && future->has_exception();
+ return future_ && future_->has_exception();
         }
 
- bool has_value() const
+ bool has_value() const BOOST_NOEXCEPT
         {
- return future && future->has_value();
+ return future_ && future_->has_value();
         }
 
+ bool valid() const BOOST_NOEXCEPT
+ {
+ return future_ != 0;
+ }
+
+
         void wait() const
         {
- if(!future)
+ if(!future_)
             {
                 boost::throw_exception(future_uninitialized());
             }
- future->wait(false);
+ future_->wait(false);
         }
 
         template<typename Duration>
@@ -745,43 +902,55 @@
 
         bool timed_wait_until(boost::system_time const& abs_time) const
         {
- if(!future)
+ if(!future_)
             {
                 boost::throw_exception(future_uninitialized());
             }
- return future->timed_wait_until(abs_time);
+ return future_->timed_wait_until(abs_time);
         }
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ future_status
+ wait_for(const chrono::duration<Rep, Period>& rel_time) const
+ {
+ return wait_until(chrono::steady_clock::now() + rel_time);
 
+ }
+ template <class Clock, class Duration>
+ future_status
+ wait_until(const chrono::time_point<Clock, Duration>& abs_time) const
+ {
+ if(!future_)
+ {
+ boost::throw_exception(future_uninitialized());
+ }
+ return future_->wait_until(abs_time);
+ }
+#endif
     };
 
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename T>
- struct has_move_emulation_enabled_aux<unique_future<T> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
-#endif
+ BOOST_THREAD_DCL_MOVABLE_BEG(T) BOOST_THREAD_FUTURE<T> BOOST_THREAD_DCL_MOVABLE_END
 
     template <typename R>
     class shared_future
     {
         typedef boost::shared_ptr<detail::future_object<R> > future_ptr;
 
- future_ptr future;
-
-// shared_future(const unique_future<R>& other);
-// shared_future& operator=(const unique_future<R>& other);
+ future_ptr future_;
 
         friend class detail::future_waiter;
         friend class promise<R>;
         friend class packaged_task<R>;
 
- shared_future(future_ptr future_):
- future(future_)
+ shared_future(future_ptr a_future):
+ future_(a_future)
         {}
 
     public:
+ BOOST_THREAD_MOVABLE(shared_future)
+
         shared_future(shared_future const& other):
- future(other.future)
+ future_(other.future_)
         {}
 
         typedef future_state::state state;
@@ -794,112 +963,85 @@
 
         shared_future& operator=(shared_future const& other)
         {
- future=other.future;
+ future_=other.future_;
             return *this;
         }
-#ifndef BOOST_NO_RVALUE_REFERENCES
- shared_future(shared_future && other)
- {
- future.swap(other.future);
- }
- shared_future(unique_future<R> && other)
- {
- future.swap(other.future);
- }
- shared_future& operator=(shared_future && other)
- {
- future.swap(other.future);
- other.future.reset();
- return *this;
- }
- shared_future& operator=(unique_future<R> && other)
- {
- future.swap(other.future);
- other.future.reset();
- return *this;
- }
-#else
- shared_future(boost::detail::thread_move_t<shared_future> other):
- future(other->future)
+ shared_future(BOOST_THREAD_RV_REF(shared_future) other) BOOST_NOEXCEPT :
+ future_(BOOST_THREAD_RV(other).future_)
         {
- other->future.reset();
+ BOOST_THREAD_RV(other).future_.reset();
         }
-// shared_future(const unique_future<R> &) = delete;
- shared_future(boost::detail::thread_move_t<unique_future<R> > other):
- future(other->future)
+ shared_future(BOOST_THREAD_RV_REF_BEG BOOST_THREAD_FUTURE<R> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT :
+ future_(BOOST_THREAD_RV(other).future_)
         {
- other->future.reset();
+ BOOST_THREAD_RV(other).future_.reset();
         }
- shared_future& operator=(boost::detail::thread_move_t<shared_future> other)
+ shared_future& operator=(BOOST_THREAD_RV_REF(shared_future) other) BOOST_NOEXCEPT
         {
- future.swap(other->future);
- other->future.reset();
+ future_.swap(BOOST_THREAD_RV(other).future_);
+ BOOST_THREAD_RV(other).future_.reset();
             return *this;
         }
- shared_future& operator=(boost::detail::thread_move_t<unique_future<R> > other)
+ shared_future& operator=(BOOST_THREAD_RV_REF_BEG BOOST_THREAD_FUTURE<R> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
         {
- future.swap(other->future);
- other->future.reset();
+ future_.swap(BOOST_THREAD_RV(other).future_);
+ BOOST_THREAD_RV(other).future_.reset();
             return *this;
         }
 
- operator boost::detail::thread_move_t<shared_future>()
+ void swap(shared_future& other) BOOST_NOEXCEPT
         {
- return boost::detail::thread_move_t<shared_future>(*this);
- }
-
-#endif
-
- void swap(shared_future& other)
- {
- future.swap(other.future);
+ future_.swap(other.future_);
         }
 
         // retrieving the value
- //typename detail::future_object<R>::move_dest_type get()
- R get()
+ typename detail::future_object<R>::shared_future_get_result_type get()
         {
- if(!future)
+ if(!future_)
             {
                 boost::throw_exception(future_uninitialized());
             }
 
- return future->get();
+ return future_->get_sh();
         }
 
         // functions to check state, and wait for ready
- state get_state() const
+ state get_state() const BOOST_NOEXCEPT
         {
- if(!future)
+ if(!future_)
             {
                 return future_state::uninitialized;
             }
- return future->get_state();
+ return future_->get_state();
         }
 
+ bool valid() const BOOST_NOEXCEPT
+ {
+ return future_ != 0;
+ }
 
- bool is_ready() const
+ bool is_ready() const BOOST_NOEXCEPT
         {
             return get_state()==future_state::ready;
         }
 
- bool has_exception() const
+ bool has_exception() const BOOST_NOEXCEPT
         {
- return future && future->has_exception();
+ return future_ && future_->has_exception();
         }
 
- bool has_value() const
+ bool has_value() const BOOST_NOEXCEPT
         {
- return future && future->has_value();
+ return future_ && future_->has_value();
         }
 
         void wait() const
         {
- if(!future)
+ if(!future_)
             {
                 boost::throw_exception(future_uninitialized());
             }
- future->wait(false);
+ future_->wait(false);
         }
 
         template<typename Duration>
@@ -910,157 +1052,168 @@
 
         bool timed_wait_until(boost::system_time const& abs_time) const
         {
- if(!future)
+ if(!future_)
             {
                 boost::throw_exception(future_uninitialized());
             }
- return future->timed_wait_until(abs_time);
+ return future_->timed_wait_until(abs_time);
         }
+#ifdef BOOST_THREAD_USES_CHRONO
 
- };
+ template <class Rep, class Period>
+ future_status
+ wait_for(const chrono::duration<Rep, Period>& rel_time) const
+ {
+ return wait_until(chrono::steady_clock::now() + rel_time);
 
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename T>
- struct has_move_emulation_enabled_aux<shared_future<T> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
+ }
+ template <class Clock, class Duration>
+ future_status
+ wait_until(const chrono::time_point<Clock, Duration>& abs_time) const
+ {
+ if(!future_)
+ {
+ boost::throw_exception(future_uninitialized());
+ }
+ return future_->wait_until(abs_time);
+ }
 #endif
+ };
+
+ BOOST_THREAD_DCL_MOVABLE_BEG(T) shared_future<T> BOOST_THREAD_DCL_MOVABLE_END
 
     template <typename R>
     class promise
     {
         typedef boost::shared_ptr<detail::future_object<R> > future_ptr;
 
- future_ptr future;
+ future_ptr future_;
         bool future_obtained;
 
- promise(promise & rhs);// = delete;
- promise & operator=(promise & rhs);// = delete;
-
         void lazy_init()
         {
- if(!atomic_load(&future))
+#if defined BOOST_THREAD_PROMISE_LAZY
+ if(!atomic_load(&future_))
             {
                 future_ptr blank;
- atomic_compare_exchange(&future,&blank,future_ptr(new detail::future_object<R>));
+ atomic_compare_exchange(&future_,&blank,future_ptr(new detail::future_object<R>));
             }
+#endif
         }
 
     public:
-// template <class Allocator> explicit promise(Allocator a);
+ BOOST_THREAD_MOVABLE_ONLY(promise)
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+ template <class Allocator>
+ promise(boost::allocator_arg_t, Allocator a)
+ {
+ typedef typename Allocator::template rebind<detail::future_object<R> >::other A2;
+ A2 a2(a);
+ typedef thread_detail::allocator_destructor<A2> D;
 
+ future_ = future_ptr(::new(a2.allocate(1)) detail::future_object<R>(), D(a2, 1) );
+ future_obtained = false;
+ }
+#endif
         promise():
- future(),future_obtained(false)
+#if defined BOOST_THREAD_PROMISE_LAZY
+ future_(),
+#else
+ future_(new detail::future_object<R>()),
+#endif
+ future_obtained(false)
         {}
 
         ~promise()
         {
- if(future)
+ if(future_)
             {
- boost::lock_guard<boost::mutex> lock(future->mutex);
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
 
- if(!future->done)
+ if(!future_->done)
                 {
- future->mark_exceptional_finish_internal(boost::copy_exception(broken_promise()));
+ future_->mark_exceptional_finish_internal(boost::copy_exception(broken_promise()));
                 }
             }
         }
 
         // Assignment
-#ifndef BOOST_NO_RVALUE_REFERENCES
- promise(promise && rhs):
- future_obtained(rhs.future_obtained)
+ promise(BOOST_THREAD_RV_REF(promise) rhs) BOOST_NOEXCEPT :
+ future_(BOOST_THREAD_RV(rhs).future_),future_obtained(BOOST_THREAD_RV(rhs).future_obtained)
         {
- future.swap(rhs.future);
- rhs.future_obtained=false;
+ BOOST_THREAD_RV(rhs).future_.reset();
+ BOOST_THREAD_RV(rhs).future_obtained=false;
         }
- promise & operator=(promise&& rhs)
+ promise & operator=(BOOST_THREAD_RV_REF(promise) rhs) BOOST_NOEXCEPT
         {
- future.swap(rhs.future);
- future_obtained=rhs.future_obtained;
- rhs.future.reset();
- rhs.future_obtained=false;
- return *this;
- }
-#else
- promise(boost::detail::thread_move_t<promise> rhs):
- future(rhs->future),future_obtained(rhs->future_obtained)
- {
- rhs->future.reset();
- rhs->future_obtained=false;
- }
- promise & operator=(boost::detail::thread_move_t<promise> rhs)
- {
- future=rhs->future;
- future_obtained=rhs->future_obtained;
- rhs->future.reset();
- rhs->future_obtained=false;
+ future_=BOOST_THREAD_RV(rhs).future_;
+ future_obtained=BOOST_THREAD_RV(rhs).future_obtained;
+ BOOST_THREAD_RV(rhs).future_.reset();
+ BOOST_THREAD_RV(rhs).future_obtained=false;
             return *this;
         }
 
- operator boost::detail::thread_move_t<promise>()
- {
- return boost::detail::thread_move_t<promise>(*this);
- }
-#endif
-
         void swap(promise& other)
         {
- future.swap(other.future);
+ future_.swap(other.future_);
             std::swap(future_obtained,other.future_obtained);
         }
 
         // Result retrieval
- unique_future<R> get_future()
+ BOOST_THREAD_FUTURE<R> get_future()
         {
             lazy_init();
- if(future_obtained)
+ if (future_.get()==0)
+ {
+ boost::throw_exception(promise_moved());
+ }
+ if (future_obtained)
             {
                 boost::throw_exception(future_already_retrieved());
             }
             future_obtained=true;
- return unique_future<R>(future);
+ return BOOST_THREAD_FUTURE<R>(future_);
         }
 
         void set_value(typename detail::future_traits<R>::source_reference_type r)
         {
             lazy_init();
- boost::lock_guard<boost::mutex> lock(future->mutex);
- if(future->done)
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
+ if(future_->done)
             {
                 boost::throw_exception(promise_already_satisfied());
             }
- future->mark_finished_with_result_internal(r);
+ future_->mark_finished_with_result_internal(r);
         }
 
 // void set_value(R && r);
         void set_value(typename detail::future_traits<R>::rvalue_source_type r)
         {
             lazy_init();
- boost::lock_guard<boost::mutex> lock(future->mutex);
- if(future->done)
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
+ if(future_->done)
             {
                 boost::throw_exception(promise_already_satisfied());
             }
- future->mark_finished_with_result_internal(static_cast<typename detail::future_traits<R>::rvalue_source_type>(r));
+ future_->mark_finished_with_result_internal(static_cast<typename detail::future_traits<R>::rvalue_source_type>(r));
         }
 
         void set_exception(boost::exception_ptr p)
         {
             lazy_init();
- boost::lock_guard<boost::mutex> lock(future->mutex);
- if(future->done)
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
+ if(future_->done)
             {
                 boost::throw_exception(promise_already_satisfied());
             }
- future->mark_exceptional_finish_internal(p);
+ future_->mark_exceptional_finish_internal(p);
         }
 
         template<typename F>
         void set_wait_callback(F f)
         {
             lazy_init();
- future->set_wait_callback(f,this);
+ future_->set_wait_callback(f,this);
         }
 
     };
@@ -1070,135 +1223,140 @@
     {
         typedef boost::shared_ptr<detail::future_object<void> > future_ptr;
 
- future_ptr future;
+ future_ptr future_;
         bool future_obtained;
 
- promise(promise & rhs);// = delete;
- promise & operator=(promise & rhs);// = delete;
-
         void lazy_init()
         {
- if(!atomic_load(&future))
+#if defined BOOST_THREAD_PROMISE_LAZY
+ if(!atomic_load(&future_))
             {
                 future_ptr blank;
- atomic_compare_exchange(&future,&blank,future_ptr(new detail::future_object<void>));
+ atomic_compare_exchange(&future_,&blank,future_ptr(new detail::future_object<void>));
             }
+#endif
         }
     public:
-// template <class Allocator> explicit promise(Allocator a);
+ BOOST_THREAD_MOVABLE_ONLY(promise)
 
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+ template <class Allocator>
+ promise(boost::allocator_arg_t, Allocator a)
+ {
+ typedef typename Allocator::template rebind<detail::future_object<void> >::other A2;
+ A2 a2(a);
+ typedef thread_detail::allocator_destructor<A2> D;
+
+ future_ = future_ptr(::new(a2.allocate(1)) detail::future_object<void>(), D(a2, 1) );
+ future_obtained = false;
+ }
+#endif
         promise():
- future(),future_obtained(false)
+#if defined BOOST_THREAD_PROMISE_LAZY
+ future_(),
+#else
+ future_(new detail::future_object<void>),
+#endif
+ future_obtained(false)
         {}
 
         ~promise()
         {
- if(future)
+ if(future_)
             {
- boost::lock_guard<boost::mutex> lock(future->mutex);
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
 
- if(!future->done)
+ if(!future_->done)
                 {
- future->mark_exceptional_finish_internal(boost::copy_exception(broken_promise()));
+ future_->mark_exceptional_finish_internal(boost::copy_exception(broken_promise()));
                 }
             }
         }
 
         // Assignment
-#ifndef BOOST_NO_RVALUE_REFERENCES
- promise(promise && rhs):
- future_obtained(rhs.future_obtained)
+ promise(BOOST_THREAD_RV_REF(promise) rhs) BOOST_NOEXCEPT :
+ future_(BOOST_THREAD_RV(rhs).future_),future_obtained(BOOST_THREAD_RV(rhs).future_obtained)
         {
- future.swap(rhs.future);
- rhs.future_obtained=false;
- }
- promise & operator=(promise&& rhs)
- {
- future.swap(rhs.future);
- future_obtained=rhs.future_obtained;
- rhs.future.reset();
- rhs.future_obtained=false;
- return *this;
- }
-#else
- promise(boost::detail::thread_move_t<promise> rhs):
- future(rhs->future),future_obtained(rhs->future_obtained)
- {
- rhs->future.reset();
- rhs->future_obtained=false;
- }
- promise & operator=(boost::detail::thread_move_t<promise> rhs)
- {
- future=rhs->future;
- future_obtained=rhs->future_obtained;
- rhs->future.reset();
- rhs->future_obtained=false;
- return *this;
+ // we need to release the future as shared_ptr doesn't implements move semantics
+ BOOST_THREAD_RV(rhs).future_.reset();
+ BOOST_THREAD_RV(rhs).future_obtained=false;
         }
 
- operator boost::detail::thread_move_t<promise>()
+ promise & operator=(BOOST_THREAD_RV_REF(promise) rhs) BOOST_NOEXCEPT
         {
- return boost::detail::thread_move_t<promise>(*this);
+ future_=BOOST_THREAD_RV(rhs).future_;
+ future_obtained=BOOST_THREAD_RV(rhs).future_obtained;
+ BOOST_THREAD_RV(rhs).future_.reset();
+ BOOST_THREAD_RV(rhs).future_obtained=false;
+ return *this;
         }
-#endif
 
         void swap(promise& other)
         {
- future.swap(other.future);
+ future_.swap(other.future_);
             std::swap(future_obtained,other.future_obtained);
         }
 
         // Result retrieval
- unique_future<void> get_future()
+ BOOST_THREAD_FUTURE<void> get_future()
         {
             lazy_init();
 
+ if (future_.get()==0)
+ {
+ boost::throw_exception(promise_moved());
+ }
             if(future_obtained)
             {
                 boost::throw_exception(future_already_retrieved());
             }
             future_obtained=true;
- return unique_future<void>(future);
+ return BOOST_THREAD_FUTURE<void>(future_);
         }
 
         void set_value()
         {
             lazy_init();
- boost::lock_guard<boost::mutex> lock(future->mutex);
- if(future->done)
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
+ if(future_->done)
             {
                 boost::throw_exception(promise_already_satisfied());
             }
- future->mark_finished_with_result_internal();
+ future_->mark_finished_with_result_internal();
         }
 
         void set_exception(boost::exception_ptr p)
         {
             lazy_init();
- boost::lock_guard<boost::mutex> lock(future->mutex);
- if(future->done)
+ boost::lock_guard<boost::mutex> lock(future_->mutex);
+ if(future_->done)
             {
                 boost::throw_exception(promise_already_satisfied());
             }
- future->mark_exceptional_finish_internal(p);
+ future_->mark_exceptional_finish_internal(p);
         }
 
         template<typename F>
         void set_wait_callback(F f)
         {
             lazy_init();
- future->set_wait_callback(f,this);
+ future_->set_wait_callback(f,this);
         }
 
     };
 
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename T>
- struct has_move_emulation_enabled_aux<promise<T> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+ namespace container
+ {
+ template <class R, class Alloc>
+ struct uses_allocator<promise<R> , Alloc> : true_type
+ {
+ };
+ }
 #endif
 
+ BOOST_THREAD_DCL_MOVABLE_BEG(T) promise<T> BOOST_THREAD_DCL_MOVABLE_END
+
     namespace detail
     {
         template<typename R>
@@ -1211,6 +1369,10 @@
                 started(false)
             {}
 
+ void reset()
+ {
+ started=false;
+ }
             void run()
             {
                 {
@@ -1243,26 +1405,32 @@
         struct task_object:
             task_base<R>
         {
+ private:
+ task_object(task_object&);
+ public:
             F f;
             task_object(F const& f_):
                 f(f_)
             {}
 #ifndef BOOST_NO_RVALUE_REFERENCES
- task_object(F&& f_):
- f(f_)
+ task_object(BOOST_THREAD_RV_REF(F) f_):
+ f(boost::forward<F>(f_))
             {}
 #else
- task_object(boost::detail::thread_move_t<F> f_):
- f(f_)
+ task_object(BOOST_THREAD_RV_REF(F) f_):
+ f(boost::move(f_))
             {}
 #endif
-
             void do_run()
             {
                 try
                 {
                     this->mark_finished_with_result(f());
                 }
+ catch(thread_interrupted& )
+ {
+ this->mark_interrupted_finish();
+ }
                 catch(...)
                 {
                     this->mark_exceptional_finish();
@@ -1274,17 +1442,20 @@
         struct task_object<void,F>:
             task_base<void>
         {
+ private:
+ task_object(task_object&);
+ public:
             F f;
             task_object(F const& f_):
                 f(f_)
             {}
 #ifndef BOOST_NO_RVALUE_REFERENCES
- task_object(F&& f_):
- f(f_)
+ task_object(BOOST_THREAD_RV_REF(F) f_):
+ f(boost::forward<F>(f_))
             {}
 #else
- task_object(boost::detail::thread_move_t<F> f_):
- f(f_)
+ task_object(BOOST_THREAD_RV_REF(F) f_):
+ f(boost::move(f_))
             {}
 #endif
 
@@ -1295,6 +1466,10 @@
                     f();
                     this->mark_finished_with_result();
                 }
+ catch(thread_interrupted& )
+ {
+ this->mark_interrupted_finish();
+ }
                 catch(...)
                 {
                     this->mark_exceptional_finish();
@@ -1304,47 +1479,91 @@
 
     }
 
-
     template<typename R>
     class packaged_task
     {
+ typedef boost::shared_ptr<detail::task_base<R> > task_ptr;
         boost::shared_ptr<detail::task_base<R> > task;
         bool future_obtained;
 
- packaged_task(packaged_task&);// = delete;
- packaged_task& operator=(packaged_task&);// = delete;
-
     public:
+ typedef R result_type;
+ BOOST_THREAD_MOVABLE_ONLY(packaged_task)
+
         packaged_task():
             future_obtained(false)
         {}
 
         // construction and destruction
- template <class F>
- explicit packaged_task(F const& f):
- task(new detail::task_object<R,F>(f)),future_obtained(false)
- {}
+
         explicit packaged_task(R(*f)()):
             task(new detail::task_object<R,R(*)()>(f)),future_obtained(false)
         {}
-
 #ifndef BOOST_NO_RVALUE_REFERENCES
         template <class F>
- explicit packaged_task(F&& f):
- task(new detail::task_object<R,F>(f)),future_obtained(false)
+ explicit packaged_task(BOOST_THREAD_RV_REF(F) f):
+ task(new detail::task_object<R,
+ typename remove_cv<typename remove_reference<F>::type>::type
+ >(boost::forward<F>(f))),future_obtained(false)
         {}
 #else
         template <class F>
- explicit packaged_task(boost::detail::thread_move_t<F> f):
+ explicit packaged_task(F const& f):
             task(new detail::task_object<R,F>(f)),future_obtained(false)
         {}
+ template <class F>
+ explicit packaged_task(BOOST_THREAD_RV_REF(F) f):
+ task(new detail::task_object<R,F>(boost::move(f))),future_obtained(false)
+ {}
 #endif
 
-// template <class F, class Allocator>
-// explicit packaged_task(F const& f, Allocator a);
-// template <class F, class Allocator>
-// explicit packaged_task(F&& f, Allocator a);
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+ template <class Allocator>
+ packaged_task(boost::allocator_arg_t, Allocator a, R(*f)())
+ {
+ typedef R(*FR)();
+ typedef typename Allocator::template rebind<detail::task_object<R,FR> >::other A2;
+ A2 a2(a);
+ typedef thread_detail::allocator_destructor<A2> D;
+
+ task = task_ptr(::new(a2.allocate(1)) detail::task_object<R,FR>(f), D(a2, 1) );
+ future_obtained = false;
+ }
+#ifndef BOOST_NO_RVALUE_REFERENCES
+ template <class F, class Allocator>
+ packaged_task(boost::allocator_arg_t, Allocator a, BOOST_THREAD_RV_REF(F) f)
+ {
+ typedef typename remove_cv<typename remove_reference<F>::type>::type FR;
+ typedef typename Allocator::template rebind<detail::task_object<R,FR> >::other A2;
+ A2 a2(a);
+ typedef thread_detail::allocator_destructor<A2> D;
+
+ task = task_ptr(::new(a2.allocate(1)) detail::task_object<R,FR>(boost::forward<F>(f)), D(a2, 1) );
+ future_obtained = false;
+ }
+#else
+ template <class F, class Allocator>
+ packaged_task(boost::allocator_arg_t, Allocator a, const F& f)
+ {
+ typedef typename Allocator::template rebind<detail::task_object<R,F> >::other A2;
+ A2 a2(a);
+ typedef thread_detail::allocator_destructor<A2> D;
 
+ task = task_ptr(::new(a2.allocate(1)) detail::task_object<R,F>(f), D(a2, 1) );
+ future_obtained = false;
+ }
+ template <class F, class Allocator>
+ packaged_task(boost::allocator_arg_t, Allocator a, BOOST_THREAD_RV_REF(F) f)
+ {
+ typedef typename Allocator::template rebind<detail::task_object<R,F> >::other A2;
+ A2 a2(a);
+ typedef thread_detail::allocator_destructor<A2> D;
+
+ task = task_ptr(::new(a2.allocate(1)) detail::task_object<R,F>(boost::move(f)), D(a2, 1) );
+ future_obtained = false;
+ }
+#endif //BOOST_NO_RVALUE_REFERENCES
+#endif // BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
 
         ~packaged_task()
         {
@@ -1355,46 +1574,39 @@
         }
 
         // assignment
-#ifndef BOOST_NO_RVALUE_REFERENCES
- packaged_task(packaged_task&& other):
- future_obtained(other.future_obtained)
- {
- task.swap(other.task);
- other.future_obtained=false;
- }
- packaged_task& operator=(packaged_task&& other)
- {
- packaged_task temp(static_cast<packaged_task&&>(other));
- swap(temp);
- return *this;
- }
-#else
- packaged_task(boost::detail::thread_move_t<packaged_task> other):
- future_obtained(other->future_obtained)
+ packaged_task(BOOST_THREAD_RV_REF(packaged_task) other) BOOST_NOEXCEPT :
+ future_obtained(BOOST_THREAD_RV(other).future_obtained)
         {
- task.swap(other->task);
- other->future_obtained=false;
+ task.swap(BOOST_THREAD_RV(other).task);
+ BOOST_THREAD_RV(other).future_obtained=false;
         }
- packaged_task& operator=(boost::detail::thread_move_t<packaged_task> other)
+ packaged_task& operator=(BOOST_THREAD_RV_REF(packaged_task) other) BOOST_NOEXCEPT
         {
- packaged_task temp(other);
+ packaged_task temp(static_cast<BOOST_THREAD_RV_REF(packaged_task)>(other));
             swap(temp);
             return *this;
         }
- operator boost::detail::thread_move_t<packaged_task>()
+
+ void reset()
         {
- return boost::detail::thread_move_t<packaged_task>(*this);
+ if (!valid())
+ throw future_error(system::make_error_code(future_errc::no_state));
+ task->reset();
+ future_obtained=false;
         }
-#endif
 
- void swap(packaged_task& other)
+ void swap(packaged_task& other) BOOST_NOEXCEPT
         {
             task.swap(other.task);
             std::swap(future_obtained,other.future_obtained);
         }
+ bool valid() const BOOST_NOEXCEPT
+ {
+ return task.get()!=0;
+ }
 
         // result retrieval
- unique_future<R> get_future()
+ BOOST_THREAD_FUTURE<R> get_future()
         {
             if(!task)
             {
@@ -1403,12 +1615,14 @@
             else if(!future_obtained)
             {
                 future_obtained=true;
- return unique_future<R>(task);
+ return BOOST_THREAD_FUTURE<R>(task);
             }
             else
             {
                 boost::throw_exception(future_already_retrieved());
             }
+ return BOOST_THREAD_FUTURE<R>();
+
         }
 
 
@@ -1430,13 +1644,18 @@
 
     };
 
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename T>
- struct has_move_emulation_enabled_aux<packaged_task<T> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CTOR_ALLOCATORS
+ namespace container
+ {
+ template <class R, class Alloc>
+ struct uses_allocator<packaged_task<R>, Alloc>
+ : public true_type {};
+ }
 #endif
 
+ BOOST_THREAD_DCL_MOVABLE_BEG(T) packaged_task<T> BOOST_THREAD_DCL_MOVABLE_END
+
+
 }
 
 

Modified: branches/release/boost/thread/locks.hpp
==============================================================================
--- branches/release/boost/thread/locks.hpp (original)
+++ branches/release/boost/thread/locks.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -2,6 +2,8 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2007 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
+
 #ifndef BOOST_THREAD_LOCKS_HPP
 #define BOOST_THREAD_LOCKS_HPP
 #include <boost/thread/detail/config.hpp>
@@ -12,6 +14,10 @@
 #include <boost/thread/thread_time.hpp>
 #include <boost/detail/workaround.hpp>
 #include <boost/type_traits/is_class.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/time_point.hpp>
+#include <boost/chrono/duration.hpp>
+#endif
 
 #include <boost/config/abi_prefix.hpp>
 
@@ -248,9 +254,10 @@
     private:
         Mutex& m;
 
- explicit lock_guard(lock_guard&);
- lock_guard& operator=(lock_guard&);
     public:
+ typedef Mutex mutex_type;
+ BOOST_THREAD_NO_COPYABLE(lock_guard)
+
         explicit lock_guard(Mutex& m_):
             m(m_)
         {
@@ -265,22 +272,26 @@
         }
     };
 
-
     template<typename Mutex>
     class unique_lock
     {
     private:
         Mutex* m;
         bool is_locked;
- unique_lock(unique_lock&);
+
+ private:
         explicit unique_lock(upgrade_lock<Mutex>&);
- unique_lock& operator=(unique_lock&);
         unique_lock& operator=(upgrade_lock<Mutex>& other);
     public:
+ typedef Mutex mutex_type;
+ BOOST_THREAD_MOVABLE_ONLY(unique_lock)
+
+#if 0 // This should not be needed anymore. Use instead BOOST_THREAD_MAKE_RV_REF.
 #if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
         unique_lock(const volatile unique_lock&);
 #endif
- unique_lock():
+#endif
+ unique_lock() BOOST_NOEXCEPT :
             m(0),is_locked(false)
         {}
 
@@ -292,7 +303,7 @@
         unique_lock(Mutex& m_,adopt_lock_t):
             m(&m_),is_locked(true)
         {}
- unique_lock(Mutex& m_,defer_lock_t):
+ unique_lock(Mutex& m_,defer_lock_t) BOOST_NOEXCEPT:
             m(&m_),is_locked(false)
         {}
         unique_lock(Mutex& m_,try_to_lock_t):
@@ -311,86 +322,167 @@
         {
             timed_lock(target_time);
         }
-#ifndef BOOST_NO_RVALUE_REFERENCES
- unique_lock(unique_lock&& other):
- m(other.m),is_locked(other.is_locked)
+
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Clock, class Duration>
+ unique_lock(Mutex& mtx, const chrono::time_point<Clock, Duration>& t)
+ : m(&mtx), is_locked(mtx.try_lock_until(t))
         {
- other.is_locked=false;
- other.m=0;
         }
- explicit unique_lock(upgrade_lock<Mutex>&& other);
-
- unique_lock<Mutex>&& move()
+ template <class Rep, class Period>
+ unique_lock(Mutex& mtx, const chrono::duration<Rep, Period>& d)
+ : m(&mtx), is_locked(mtx.try_lock_for(d))
         {
- return static_cast<unique_lock<Mutex>&&>(*this);
         }
+#endif
 
+ unique_lock(BOOST_THREAD_RV_REF(unique_lock) other) BOOST_NOEXCEPT:
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
+ {
+ BOOST_THREAD_RV(other).is_locked=false;
+ BOOST_THREAD_RV(other).m=0;
+ }
+ BOOST_THREAD_EXPLICIT_LOCK_CONVERSION unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other);
 
- unique_lock& operator=(unique_lock&& other)
+#ifndef BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
+ unique_lock& operator=(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
         {
- unique_lock temp(other.move());
+ unique_lock temp(::boost::move(other));
             swap(temp);
             return *this;
         }
+#endif
 
- unique_lock& operator=(upgrade_lock<Mutex>&& other)
+ unique_lock& operator=(BOOST_THREAD_RV_REF(unique_lock) other) BOOST_NOEXCEPT
         {
- unique_lock temp(other.move());
+ unique_lock temp(::boost::move(other));
             swap(temp);
             return *this;
         }
- void swap(unique_lock&& other)
- {
- std::swap(m,other.m);
- std::swap(is_locked,other.is_locked);
- }
-#else
- unique_lock(detail::thread_move_t<unique_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
+#if 0 // This should not be needed anymore. Use instead BOOST_THREAD_MAKE_RV_REF.
+#if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
+ unique_lock& operator=(unique_lock<Mutex> other)
         {
- other->is_locked=false;
- other->m=0;
+ swap(other);
+ return *this;
         }
- unique_lock(detail::thread_move_t<upgrade_lock<Mutex> > other);
+#endif // BOOST_WORKAROUND
+#endif
 
- operator detail::thread_move_t<unique_lock<Mutex> >()
+ // Conversion from upgrade locking
+ unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<mutex_type> BOOST_THREAD_RV_REF_END ul, try_to_lock_t)
+ : m(0),is_locked(false)
         {
- return move();
+ if (BOOST_THREAD_RV(ul).owns_lock()) {
+ if (BOOST_THREAD_RV(ul).mutex()->try_unlock_upgrade_and_lock())
+ {
+ m = BOOST_THREAD_RV(ul).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(ul).release();
+ }
         }
 
- detail::thread_move_t<unique_lock<Mutex> > move()
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Clock, class Duration>
+ unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<mutex_type> BOOST_THREAD_RV_REF_END ul,
+ const chrono::time_point<Clock, Duration>& abs_time)
+ : m(0),is_locked(false)
         {
- return detail::thread_move_t<unique_lock<Mutex> >(*this);
+ if (BOOST_THREAD_RV(ul).owns_lock()) {
+ if (BOOST_THREAD_RV(ul).mutex()->try_unlock_upgrade_and_lock_until(abs_time))
+ {
+ m = BOOST_THREAD_RV(ul).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(ul).release();
+ }
         }
 
-#if BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100)
- unique_lock& operator=(unique_lock<Mutex> other)
+ template <class Rep, class Period>
+ unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<mutex_type> BOOST_THREAD_RV_REF_END ul,
+ const chrono::duration<Rep, Period>& rel_time)
+ : m(0),is_locked(false)
         {
- swap(other);
- return *this;
+ if (BOOST_THREAD_RV(ul).owns_lock()) {
+ if (BOOST_THREAD_RV(ul).mutex()->try_unlock_upgrade_and_lock_for(rel_time))
+ {
+ m = BOOST_THREAD_RV(ul).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(ul).release();
+ }
         }
-#else
- unique_lock& operator=(detail::thread_move_t<unique_lock<Mutex> > other)
+#endif
+
+#ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+ // Conversion from shared locking
+ unique_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl, try_to_lock_t)
+ : m(0),is_locked(false)
         {
- unique_lock temp(other);
- swap(temp);
- return *this;
+ if (BOOST_THREAD_RV(sl).owns_lock()) {
+ if (BOOST_THREAD_RV(sl).mutex()->try_unlock_shared_and_lock())
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ }
         }
-#endif
 
- unique_lock& operator=(detail::thread_move_t<upgrade_lock<Mutex> > other)
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Clock, class Duration>
+ unique_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl,
+ const chrono::time_point<Clock, Duration>& abs_time)
+ : m(0),is_locked(false)
         {
- unique_lock temp(other);
- swap(temp);
- return *this;
+ if (BOOST_THREAD_RV(sl).owns_lock()) {
+ if (BOOST_THREAD_RV(sl).mutex()->try_unlock_shared_and_lock_until(abs_time))
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ }
         }
- void swap(detail::thread_move_t<unique_lock<Mutex> > other)
+
+ template <class Rep, class Period>
+ unique_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl,
+ const chrono::duration<Rep, Period>& rel_time)
+ : m(0),is_locked(false)
         {
- std::swap(m,other->m);
- std::swap(is_locked,other->is_locked);
+ if (BOOST_THREAD_RV(sl).owns_lock()) {
+ if (BOOST_THREAD_RV(sl).mutex()->try_unlock_shared_and_lock_for(rel_time))
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ }
         }
-#endif
- void swap(unique_lock& other)
+#endif // BOOST_THREAD_USES_CHRONO
+#endif // BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+
+
+ void swap(unique_lock& other) BOOST_NOEXCEPT
         {
             std::swap(m,other.m);
             std::swap(is_locked,other.is_locked);
@@ -405,18 +497,26 @@
         }
         void lock()
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
             if(owns_lock())
             {
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
             }
             m->lock();
             is_locked=true;
         }
         bool try_lock()
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
             if(owns_lock())
             {
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
             }
             is_locked=m->try_lock();
             return is_locked;
@@ -424,50 +524,118 @@
         template<typename TimeDuration>
         bool timed_lock(TimeDuration const& relative_time)
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
+ }
             is_locked=m->timed_lock(relative_time);
             return is_locked;
         }
 
         bool timed_lock(::boost::system_time const& absolute_time)
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
+ }
             is_locked=m->timed_lock(absolute_time);
             return is_locked;
         }
         bool timed_lock(::boost::xtime const& absolute_time)
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
+ }
             is_locked=m->timed_lock(absolute_time);
             return is_locked;
         }
+
+#ifdef BOOST_THREAD_USES_CHRONO
+
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
+ }
+ is_locked=m->try_lock_for(rel_time);
+ return is_locked;
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost unique_lock owns already the mutex"));
+ }
+ is_locked=m->try_lock_until(abs_time);
+ return is_locked;
+ }
+#endif
+
         void unlock()
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock has no mutex"));
+ }
             if(!owns_lock())
             {
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost unique_lock doesn't own the mutex"));
             }
             m->unlock();
             is_locked=false;
         }
 
+#if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
         typedef void (unique_lock::*bool_type)();
- operator bool_type() const
+ operator bool_type() const BOOST_NOEXCEPT
         {
             return is_locked?&unique_lock::lock:0;
         }
- bool operator!() const
+ bool operator!() const BOOST_NOEXCEPT
         {
             return !owns_lock();
         }
- bool owns_lock() const
+#else
+ explicit operator bool() const BOOST_NOEXCEPT
+ {
+ return owns_lock();
+ }
+#endif
+ bool owns_lock() const BOOST_NOEXCEPT
         {
             return is_locked;
         }
 
- Mutex* mutex() const
+ Mutex* mutex() const BOOST_NOEXCEPT
         {
             return m;
         }
 
- Mutex* release()
+ Mutex* release() BOOST_NOEXCEPT
         {
             Mutex* const res=m;
             m=0;
@@ -479,51 +647,13 @@
         friend class upgrade_lock<Mutex>;
     };
 
-#ifndef BOOST_NO_RVALUE_REFERENCES
- template<typename Mutex>
- void swap(unique_lock<Mutex>&& lhs,unique_lock<Mutex>&& rhs)
- {
- lhs.swap(rhs);
- }
-
- template<typename Mutex>
- inline upgrade_lock<Mutex>&& move(upgrade_lock<Mutex>&& ul)
- {
- return static_cast<upgrade_lock<Mutex>&&>(ul);
- }
-
     template<typename Mutex>
- inline upgrade_lock<Mutex>&& move(upgrade_lock<Mutex>& ul)
- {
- return static_cast<upgrade_lock<Mutex>&&>(ul);
- }
-#endif
- template<typename Mutex>
- void swap(unique_lock<Mutex>& lhs,unique_lock<Mutex>& rhs)
+ void swap(unique_lock<Mutex>& lhs,unique_lock<Mutex>& rhs) BOOST_NOEXCEPT
     {
         lhs.swap(rhs);
     }
 
-#ifndef BOOST_NO_RVALUE_REFERENCES
- template<typename Mutex>
- inline unique_lock<Mutex>&& move(unique_lock<Mutex>&& ul)
- {
- return static_cast<unique_lock<Mutex>&&>(ul);
- }
-
- template<typename Mutex>
- inline unique_lock<Mutex>&& move(unique_lock<Mutex>& ul)
- {
- return static_cast<unique_lock<Mutex>&&>(ul);
- }
-#endif
-
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename Mutex>
- struct has_move_emulation_enabled_aux<unique_lock<Mutex> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
-#endif
+ BOOST_THREAD_DCL_MOVABLE_BEG(Mutex) unique_lock<Mutex> BOOST_THREAD_DCL_MOVABLE_END
 
     template<typename Mutex>
     class shared_lock
@@ -531,11 +661,12 @@
     protected:
         Mutex* m;
         bool is_locked;
- private:
- explicit shared_lock(shared_lock&);
- shared_lock& operator=(shared_lock&);
+
     public:
- shared_lock():
+ typedef Mutex mutex_type;
+ BOOST_THREAD_MOVABLE_ONLY(shared_lock)
+
+ shared_lock() BOOST_NOEXCEPT:
             m(0),is_locked(false)
         {}
 
@@ -547,7 +678,7 @@
         shared_lock(Mutex& m_,adopt_lock_t):
             m(&m_),is_locked(true)
         {}
- shared_lock(Mutex& m_,defer_lock_t):
+ shared_lock(Mutex& m_,defer_lock_t) BOOST_NOEXCEPT:
             m(&m_),is_locked(false)
         {}
         shared_lock(Mutex& m_,try_to_lock_t):
@@ -560,93 +691,89 @@
         {
             timed_lock(target_time);
         }
-#ifndef BOOST_NO_RVALUE_REFERENCES
 
-#else
- shared_lock(detail::thread_move_t<shared_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Clock, class Duration>
+ shared_lock(Mutex& mtx, const chrono::time_point<Clock, Duration>& t)
+ : m(&mtx), is_locked(mtx.try_lock_shared_until(t))
+ {
+ }
+ template <class Rep, class Period>
+ shared_lock(Mutex& mtx, const chrono::duration<Rep, Period>& d)
+ : m(&mtx), is_locked(mtx.try_lock_shared_for(d))
+ {
+ }
+#endif
+
+ shared_lock(BOOST_THREAD_RV_REF_BEG shared_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT:
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
         {
- other->is_locked=false;
- other->m=0;
+ BOOST_THREAD_RV(other).is_locked=false;
+ BOOST_THREAD_RV(other).m=0;
         }
 
- shared_lock(detail::thread_move_t<unique_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
+ BOOST_THREAD_EXPLICIT_LOCK_CONVERSION shared_lock(BOOST_THREAD_RV_REF_BEG unique_lock<Mutex> BOOST_THREAD_RV_REF_END other):
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
         {
             if(is_locked)
             {
                 m->unlock_and_lock_shared();
             }
- other->is_locked=false;
- other->m=0;
+ BOOST_THREAD_RV(other).is_locked=false;
+ BOOST_THREAD_RV(other).m=0;
         }
 
- shared_lock(detail::thread_move_t<upgrade_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
+ BOOST_THREAD_EXPLICIT_LOCK_CONVERSION shared_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other):
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
         {
             if(is_locked)
             {
                 m->unlock_upgrade_and_lock_shared();
             }
- other->is_locked=false;
- other->m=0;
+ BOOST_THREAD_RV(other).is_locked=false;
+ BOOST_THREAD_RV(other).m=0;
         }
 
- operator detail::thread_move_t<shared_lock<Mutex> >()
- {
- return move();
- }
 
- detail::thread_move_t<shared_lock<Mutex> > move()
+ shared_lock& operator=(BOOST_THREAD_RV_REF_BEG shared_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
         {
- return detail::thread_move_t<shared_lock<Mutex> >(*this);
- }
-
-
- shared_lock& operator=(detail::thread_move_t<shared_lock<Mutex> > other)
- {
- shared_lock temp(other);
+ shared_lock temp(::boost::move(other));
             swap(temp);
             return *this;
         }
-
- shared_lock& operator=(detail::thread_move_t<unique_lock<Mutex> > other)
+#ifndef BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
+ shared_lock& operator=(BOOST_THREAD_RV_REF_BEG unique_lock<Mutex> BOOST_THREAD_RV_REF_END other)
         {
- shared_lock temp(other);
+ shared_lock temp(::boost::move(other));
             swap(temp);
             return *this;
         }
 
- shared_lock& operator=(detail::thread_move_t<upgrade_lock<Mutex> > other)
+ shared_lock& operator=(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other)
         {
- shared_lock temp(other);
+ shared_lock temp(::boost::move(other));
             swap(temp);
             return *this;
         }
 #endif
 
-#ifndef BOOST_NO_RVALUE_REFERENCES
- void swap(shared_lock&& other)
+ void swap(shared_lock& other) BOOST_NOEXCEPT
         {
             std::swap(m,other.m);
             std::swap(is_locked,other.is_locked);
         }
-#else
- void swap(boost::detail::thread_move_t<shared_lock<Mutex> > other)
- {
- std::swap(m,other->m);
- std::swap(is_locked,other->is_locked);
- }
-#endif
- void swap(shared_lock& other)
+
+ Mutex* mutex() const BOOST_NOEXCEPT
         {
- std::swap(m,other.m);
- std::swap(is_locked,other.is_locked);
+ return m;
         }
 
- Mutex* mutex() const
+ Mutex* release() BOOST_NOEXCEPT
         {
- return m;
+ Mutex* const res=m;
+ m=0;
+ is_locked=false;
+ return res;
         }
 
         ~shared_lock()
@@ -658,27 +785,39 @@
         }
         void lock()
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
             if(owns_lock())
             {
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
             }
             m->lock_shared();
             is_locked=true;
         }
         bool try_lock()
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
             if(owns_lock())
             {
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
             }
             is_locked=m->try_lock_shared();
             return is_locked;
         }
         bool timed_lock(boost::system_time const& target_time)
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
             if(owns_lock())
             {
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
             }
             is_locked=m->timed_lock_shared(target_time);
             return is_locked;
@@ -686,65 +825,91 @@
         template<typename Duration>
         bool timed_lock(Duration const& target_time)
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
             if(owns_lock())
             {
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
             }
             is_locked=m->timed_lock_shared(target_time);
             return is_locked;
         }
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
+ }
+ is_locked=m->try_lock_shared_for(rel_time);
+ return is_locked;
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
+ }
+ is_locked=m->try_lock_shared_until(abs_time);
+ return is_locked;
+ }
+#endif
         void unlock()
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
             if(!owns_lock())
             {
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock doesn't own the mutex"));
             }
             m->unlock_shared();
             is_locked=false;
         }
 
+#if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
         typedef void (shared_lock<Mutex>::*bool_type)();
- operator bool_type() const
+ operator bool_type() const BOOST_NOEXCEPT
         {
             return is_locked?&shared_lock::lock:0;
         }
- bool operator!() const
+ bool operator!() const BOOST_NOEXCEPT
         {
             return !owns_lock();
         }
- bool owns_lock() const
+#else
+ explicit operator bool() const BOOST_NOEXCEPT
+ {
+ return owns_lock();
+ }
+#endif
+ bool owns_lock() const BOOST_NOEXCEPT
         {
             return is_locked;
         }
 
     };
 
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename Mutex>
- struct has_move_emulation_enabled_aux<shared_lock<Mutex> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
-#endif
+ BOOST_THREAD_DCL_MOVABLE_BEG(Mutex) shared_lock<Mutex> BOOST_THREAD_DCL_MOVABLE_END
 
-
-#ifndef BOOST_NO_RVALUE_REFERENCES
- template<typename Mutex>
- void swap(shared_lock<Mutex>&& lhs,shared_lock<Mutex>&& rhs)
- {
- lhs.swap(rhs);
- }
     template<typename Mutex>
- void swap(shared_lock<Mutex>& lhs,shared_lock<Mutex>& rhs)
+ void swap(shared_lock<Mutex>& lhs,shared_lock<Mutex>& rhs) BOOST_NOEXCEPT
     {
         lhs.swap(rhs);
     }
-#else
- template<typename Mutex>
- void swap(shared_lock<Mutex>& lhs,shared_lock<Mutex>& rhs)
- {
- lhs.swap(rhs);
- }
-#endif
 
     template<typename Mutex>
     class upgrade_lock
@@ -752,11 +917,12 @@
     protected:
         Mutex* m;
         bool is_locked;
- private:
- explicit upgrade_lock(upgrade_lock&);
- upgrade_lock& operator=(upgrade_lock&);
+
     public:
- upgrade_lock():
+ typedef Mutex mutex_type;
+ BOOST_THREAD_MOVABLE_ONLY(upgrade_lock)
+
+ upgrade_lock() BOOST_NOEXCEPT:
             m(0),is_locked(false)
         {}
 
@@ -768,7 +934,7 @@
         upgrade_lock(Mutex& m_,adopt_lock_t):
             m(&m_),is_locked(true)
         {}
- upgrade_lock(Mutex& m_,defer_lock_t):
+ upgrade_lock(Mutex& m_,defer_lock_t) BOOST_NOEXCEPT:
             m(&m_),is_locked(false)
         {}
         upgrade_lock(Mutex& m_,try_to_lock_t):
@@ -776,89 +942,128 @@
         {
             try_lock();
         }
-#ifndef BOOST_NO_RVALUE_REFERENCES
- upgrade_lock(upgrade_lock<Mutex>&& other):
- m(other.m),is_locked(other.is_locked)
+
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Clock, class Duration>
+ upgrade_lock(Mutex& mtx, const chrono::time_point<Clock, Duration>& t)
+ : m(&mtx), is_locked(mtx.try_lock_upgrade_until(t))
         {
- other.is_locked=false;
- other.m=0;
         }
+ template <class Rep, class Period>
+ upgrade_lock(Mutex& mtx, const chrono::duration<Rep, Period>& d)
+ : m(&mtx), is_locked(mtx.try_lock_upgrade_for(d))
+ {
+ }
+#endif
 
- upgrade_lock(unique_lock<Mutex>&& other):
- m(other.m),is_locked(other.is_locked)
+ upgrade_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT:
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
+ {
+ BOOST_THREAD_RV(other).is_locked=false;
+ BOOST_THREAD_RV(other).m=0;
+ }
+
+ BOOST_THREAD_EXPLICIT_LOCK_CONVERSION upgrade_lock(BOOST_THREAD_RV_REF_BEG unique_lock<Mutex> BOOST_THREAD_RV_REF_END other):
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
         {
             if(is_locked)
             {
                 m->unlock_and_lock_upgrade();
             }
- other.is_locked=false;
- other.m=0;
+ BOOST_THREAD_RV(other).is_locked=false;
+ BOOST_THREAD_RV(other).m=0;
         }
 
- upgrade_lock& operator=(upgrade_lock<Mutex>&& other)
+ upgrade_lock& operator=(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
         {
- upgrade_lock temp(static_cast<upgrade_lock<Mutex>&&>(other));
+ upgrade_lock temp(::boost::move(other));
             swap(temp);
             return *this;
         }
 
- upgrade_lock& operator=(unique_lock<Mutex>&& other)
+#ifndef BOOST_THREAD_PROVIDES_EXPLICIT_LOCK_CONVERSION
+ upgrade_lock& operator=(BOOST_THREAD_RV_REF_BEG unique_lock<Mutex> BOOST_THREAD_RV_REF_END other)
         {
- upgrade_lock temp(static_cast<unique_lock<Mutex>&&>(other));
+ upgrade_lock temp(::boost::move(other));
             swap(temp);
             return *this;
         }
-#else
- upgrade_lock(detail::thread_move_t<upgrade_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
- {
- other->is_locked=false;
- other->m=0;
- }
+#endif
 
- upgrade_lock(detail::thread_move_t<unique_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
+#ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+ // Conversion from shared locking
+ upgrade_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl, try_to_lock_t)
+ : m(0),is_locked(false)
         {
- if(is_locked)
+ if (BOOST_THREAD_RV(sl).owns_lock()) {
+ if (BOOST_THREAD_RV(sl).mutex()->try_unlock_shared_and_lock_upgrade())
             {
- m->unlock_and_lock_upgrade();
+ m = BOOST_THREAD_RV(sl).release();
+ is_locked = true;
             }
- other->is_locked=false;
- other->m=0;
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ }
         }
 
- operator detail::thread_move_t<upgrade_lock<Mutex> >()
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Clock, class Duration>
+ upgrade_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl,
+ const chrono::time_point<Clock, Duration>& abs_time)
+ : m(0),is_locked(false)
         {
- return move();
+ if (BOOST_THREAD_RV(sl).owns_lock()) {
+ if (BOOST_THREAD_RV(sl).mutex()->try_unlock_shared_and_lock_upgrade_until(abs_time))
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ }
         }
 
- detail::thread_move_t<upgrade_lock<Mutex> > move()
+ template <class Rep, class Period>
+ upgrade_lock(BOOST_THREAD_RV_REF_BEG shared_lock<mutex_type> BOOST_THREAD_RV_REF_END sl,
+ const chrono::duration<Rep, Period>& rel_time)
+ : m(0),is_locked(false)
         {
- return detail::thread_move_t<upgrade_lock<Mutex> >(*this);
+ if (BOOST_THREAD_RV(sl).owns_lock()) {
+ if (BOOST_THREAD_RV(sl).mutex()->try_unlock_shared_and_lock_upgrade_for(rel_time))
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ is_locked = true;
+ }
+ }
+ else
+ {
+ m = BOOST_THREAD_RV(sl).release();
+ }
         }
+#endif // BOOST_THREAD_USES_CHRONO
+#endif // BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
 
-
- upgrade_lock& operator=(detail::thread_move_t<upgrade_lock<Mutex> > other)
+ void swap(upgrade_lock& other) BOOST_NOEXCEPT
         {
- upgrade_lock temp(other);
- swap(temp);
- return *this;
+ std::swap(m,other.m);
+ std::swap(is_locked,other.is_locked);
         }
-
- upgrade_lock& operator=(detail::thread_move_t<unique_lock<Mutex> > other)
+ Mutex* mutex() const BOOST_NOEXCEPT
         {
- upgrade_lock temp(other);
- swap(temp);
- return *this;
+ return m;
         }
-#endif
 
- void swap(upgrade_lock& other)
+ Mutex* release() BOOST_NOEXCEPT
         {
- std::swap(m,other.m);
- std::swap(is_locked,other.is_locked);
+ Mutex* const res=m;
+ m=0;
+ is_locked=false;
+ return res;
         }
-
         ~upgrade_lock()
         {
             if(owns_lock())
@@ -868,42 +1073,90 @@
         }
         void lock()
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
             if(owns_lock())
             {
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost upgrade_lock owns already the mutex"));
             }
             m->lock_upgrade();
             is_locked=true;
         }
         bool try_lock()
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
             if(owns_lock())
             {
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost upgrade_lock owns already the mutex"));
             }
             is_locked=m->try_lock_upgrade();
             return is_locked;
         }
         void unlock()
         {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
             if(!owns_lock())
             {
- boost::throw_exception(boost::lock_error());
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost upgrade_lock doesn't own the mutex"));
             }
             m->unlock_upgrade();
             is_locked=false;
         }
-
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
+ }
+ is_locked=m->try_lock_upgrade_for(rel_time);
+ return is_locked;
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ if(m==0)
+ {
+ boost::throw_exception(boost::lock_error(system::errc::operation_not_permitted, "boost shared_lock has no mutex"));
+ }
+ if(owns_lock())
+ {
+ boost::throw_exception(boost::lock_error(system::errc::resource_deadlock_would_occur, "boost shared_lock owns already the mutex"));
+ }
+ is_locked=m->try_lock_upgrade_until(abs_time);
+ return is_locked;
+ }
+#endif
+#if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
         typedef void (upgrade_lock::*bool_type)();
- operator bool_type() const
+ operator bool_type() const BOOST_NOEXCEPT
         {
             return is_locked?&upgrade_lock::lock:0;
         }
- bool operator!() const
+ bool operator!() const BOOST_NOEXCEPT
         {
             return !owns_lock();
         }
- bool owns_lock() const
+#else
+ explicit operator bool() const BOOST_NOEXCEPT
+ {
+ return owns_lock();
+ }
+#endif
+ bool owns_lock() const BOOST_NOEXCEPT
         {
             return is_locked;
         }
@@ -911,36 +1164,25 @@
         friend class unique_lock<Mutex>;
     };
 
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename Mutex>
- struct has_move_emulation_enabled_aux<upgrade_lock<Mutex> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
-#endif
-
-#ifndef BOOST_NO_RVALUE_REFERENCES
     template<typename Mutex>
- unique_lock<Mutex>::unique_lock(upgrade_lock<Mutex>&& other):
- m(other.m),is_locked(other.is_locked)
+ void swap(upgrade_lock<Mutex>& lhs,upgrade_lock<Mutex>& rhs) BOOST_NOEXCEPT
     {
- other.is_locked=false;
- if(is_locked)
- {
- m->unlock_upgrade_and_lock();
- }
+ lhs.swap(rhs);
     }
-#else
+
+ BOOST_THREAD_DCL_MOVABLE_BEG(Mutex) upgrade_lock<Mutex> BOOST_THREAD_DCL_MOVABLE_END
+
     template<typename Mutex>
- unique_lock<Mutex>::unique_lock(detail::thread_move_t<upgrade_lock<Mutex> > other):
- m(other->m),is_locked(other->is_locked)
+ unique_lock<Mutex>::unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_lock<Mutex> BOOST_THREAD_RV_REF_END other):
+ m(BOOST_THREAD_RV(other).m),is_locked(BOOST_THREAD_RV(other).is_locked)
     {
- other->is_locked=false;
         if(is_locked)
         {
             m->unlock_upgrade_and_lock();
         }
+ BOOST_THREAD_RV(other).release();
     }
-#endif
+
     template <class Mutex>
     class upgrade_to_unique_lock
     {
@@ -948,73 +1190,64 @@
         upgrade_lock<Mutex>* source;
         unique_lock<Mutex> exclusive;
 
- explicit upgrade_to_unique_lock(upgrade_to_unique_lock&);
- upgrade_to_unique_lock& operator=(upgrade_to_unique_lock&);
     public:
+ typedef Mutex mutex_type;
+ BOOST_THREAD_MOVABLE_ONLY(upgrade_to_unique_lock)
+
         explicit upgrade_to_unique_lock(upgrade_lock<Mutex>& m_):
- source(&m_),exclusive(move(*source))
+ source(&m_),exclusive(::boost::move(*source))
         {}
         ~upgrade_to_unique_lock()
         {
             if(source)
             {
- *source=move(exclusive);
+ *source=BOOST_THREAD_MAKE_RV_REF(upgrade_lock<Mutex>(::boost::move(exclusive)));
             }
         }
 
-#ifndef BOOST_NO_RVALUE_REFERENCES
- upgrade_to_unique_lock(upgrade_to_unique_lock<Mutex>&& other):
- source(other.source),exclusive(move(other.exclusive))
+ upgrade_to_unique_lock(BOOST_THREAD_RV_REF_BEG upgrade_to_unique_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT:
+ source(BOOST_THREAD_RV(other).source),exclusive(::boost::move(BOOST_THREAD_RV(other).exclusive))
         {
- other.source=0;
+ BOOST_THREAD_RV(other).source=0;
         }
 
- upgrade_to_unique_lock& operator=(upgrade_to_unique_lock<Mutex>&& other)
+ upgrade_to_unique_lock& operator=(BOOST_THREAD_RV_REF_BEG upgrade_to_unique_lock<Mutex> BOOST_THREAD_RV_REF_END other) BOOST_NOEXCEPT
         {
             upgrade_to_unique_lock temp(other);
             swap(temp);
             return *this;
         }
-#else
- upgrade_to_unique_lock(detail::thread_move_t<upgrade_to_unique_lock<Mutex> > other):
- source(other->source),exclusive(move(other->exclusive))
- {
- other->source=0;
- }
 
- upgrade_to_unique_lock& operator=(detail::thread_move_t<upgrade_to_unique_lock<Mutex> > other)
- {
- upgrade_to_unique_lock temp(other);
- swap(temp);
- return *this;
- }
-#endif
- void swap(upgrade_to_unique_lock& other)
+ void swap(upgrade_to_unique_lock& other) BOOST_NOEXCEPT
         {
             std::swap(source,other.source);
             exclusive.swap(other.exclusive);
         }
+
+#if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
         typedef void (upgrade_to_unique_lock::*bool_type)(upgrade_to_unique_lock&);
- operator bool_type() const
+ operator bool_type() const BOOST_NOEXCEPT
         {
             return exclusive.owns_lock()?&upgrade_to_unique_lock::swap:0;
         }
- bool operator!() const
+ bool operator!() const BOOST_NOEXCEPT
         {
             return !owns_lock();
         }
- bool owns_lock() const
+#else
+ explicit operator bool() const BOOST_NOEXCEPT
+ {
+ return owns_lock();
+ }
+#endif
+
+ bool owns_lock() const BOOST_NOEXCEPT
         {
             return exclusive.owns_lock();
         }
     };
 
-#ifdef BOOST_NO_RVALUE_REFERENCES
- template <typename Mutex>
- struct has_move_emulation_enabled_aux<upgrade_to_unique_lock<Mutex> >
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
-#endif
+ BOOST_THREAD_DCL_MOVABLE_BEG(Mutex) upgrade_to_unique_lock<Mutex> BOOST_THREAD_DCL_MOVABLE_END
 
     namespace detail
     {
@@ -1024,6 +1257,8 @@
         {
             typedef unique_lock<Mutex> base;
         public:
+ BOOST_THREAD_MOVABLE_ONLY(try_lock_wrapper)
+
             try_lock_wrapper()
             {}
 
@@ -1041,53 +1276,26 @@
                 base(m_,try_to_lock)
             {}
 #ifndef BOOST_NO_RVALUE_REFERENCES
- try_lock_wrapper(try_lock_wrapper&& other):
- base(other.move())
+ try_lock_wrapper(BOOST_THREAD_RV_REF(try_lock_wrapper) other):
+ base(::boost::move(other))
             {}
 
- try_lock_wrapper&& move()
- {
- return static_cast<try_lock_wrapper&&>(*this);
- }
-
- try_lock_wrapper& operator=(try_lock_wrapper<Mutex>&& other)
- {
- try_lock_wrapper temp(other.move());
- swap(temp);
- return *this;
- }
+#elif defined BOOST_THREAD_USES_MOVE
+ try_lock_wrapper(BOOST_THREAD_RV_REF(try_lock_wrapper) other):
+ base(::boost::move(static_cast<base&>(other)))
+ {}
 
- void swap(try_lock_wrapper&& other)
- {
- base::swap(other);
- }
 #else
- try_lock_wrapper(detail::thread_move_t<try_lock_wrapper<Mutex> > other):
- base(detail::thread_move_t<base>(*other))
+ try_lock_wrapper(BOOST_THREAD_RV_REF(try_lock_wrapper) other):
+ base(BOOST_THREAD_RV_REF(base)(*other))
             {}
-
- operator detail::thread_move_t<try_lock_wrapper<Mutex> >()
- {
- return move();
- }
-
- detail::thread_move_t<try_lock_wrapper<Mutex> > move()
- {
- return detail::thread_move_t<try_lock_wrapper<Mutex> >(*this);
- }
-
- try_lock_wrapper& operator=(detail::thread_move_t<try_lock_wrapper<Mutex> > other)
+#endif
+ try_lock_wrapper& operator=(BOOST_THREAD_RV_REF_BEG try_lock_wrapper<Mutex> BOOST_THREAD_RV_REF_END other)
             {
                 try_lock_wrapper temp(other);
                 swap(temp);
                 return *this;
             }
-
- void swap(detail::thread_move_t<try_lock_wrapper<Mutex> > other)
- {
- base::swap(*other);
- }
-#endif
             void swap(try_lock_wrapper& other)
             {
                 base::swap(other);
@@ -1116,36 +1324,30 @@
             {
                 return base::release();
             }
- bool operator!() const
- {
- return !this->owns_lock();
- }
 
+#if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
             typedef typename base::bool_type bool_type;
             operator bool_type() const
             {
                 return base::operator bool_type();
             }
+ bool operator!() const
+ {
+ return !this->owns_lock();
+ }
+#else
+ explicit operator bool() const
+ {
+ return owns_lock();
+ }
+#endif
         };
 
-#ifndef BOOST_NO_RVALUE_REFERENCES
- template<typename Mutex>
- void swap(try_lock_wrapper<Mutex>&& lhs,try_lock_wrapper<Mutex>&& rhs)
- {
- lhs.swap(rhs);
- }
         template<typename Mutex>
         void swap(try_lock_wrapper<Mutex>& lhs,try_lock_wrapper<Mutex>& rhs)
         {
             lhs.swap(rhs);
         }
-#else
- template<typename Mutex>
- void swap(try_lock_wrapper<Mutex>& lhs,try_lock_wrapper<Mutex>& rhs)
- {
- lhs.swap(rhs);
- }
-#endif
 
         template<typename MutexType1,typename MutexType2>
         unsigned try_lock_internal(MutexType1& m1,MutexType2& m2)
@@ -1620,7 +1822,6 @@
     }
 
 }
-
 #include <boost/config/abi_suffix.hpp>
 
 #endif

Modified: branches/release/boost/thread/once.hpp
==============================================================================
--- branches/release/boost/thread/once.hpp (original)
+++ branches/release/boost/thread/once.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -3,7 +3,7 @@
 
 // once.hpp
 //
-// (C) Copyright 2006-7 Anthony Williams
+// (C) Copyright 2006-7 Anthony Williams
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -22,6 +22,8 @@
 
 namespace boost
 {
+ // template<class Callable, class ...Args> void
+ // call_once(once_flag& flag, Callable&& func, Args&&... args);
     inline void call_once(void (*func)(),once_flag& flag)
     {
         call_once(flag,func);

Modified: branches/release/boost/thread/pthread/condition_variable.hpp
==============================================================================
--- branches/release/boost/thread/pthread/condition_variable.hpp (original)
+++ branches/release/boost/thread/pthread/condition_variable.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -4,11 +4,17 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2007-10 Anthony Williams
+// (C) Copyright 2011 Vicente J. Botet Escriba
 
 #include <boost/thread/pthread/timespec.hpp>
 #include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
 #include <boost/thread/pthread/thread_data.hpp>
 #include <boost/thread/pthread/condition_variable_fwd.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
+#include <boost/thread/detail/delete.hpp>
 
 #include <boost/config/abi_prefix.hpp>
 
@@ -59,18 +65,22 @@
         this_thread::interruption_point();
         if(res)
         {
- boost::throw_exception(condition_error());
+ boost::throw_exception(condition_error(res, "boost:: condition_variable constructor failed in pthread_cond_wait"));
         }
     }
 
- inline bool condition_variable::timed_wait(unique_lock<mutex>& m,boost::system_time const& wait_until)
+ inline bool condition_variable::do_timed_wait(
+ unique_lock<mutex>& m,
+ struct timespec const &timeout)
     {
+ if (!m.owns_lock())
+ boost::throw_exception(condition_error(EPERM, "condition_variable do_timed_wait: mutex not locked"));
+
         thread_cv_detail::lock_on_exit<unique_lock<mutex> > guard;
         int cond_res;
         {
             detail::interruption_checker check_for_interruption(&internal_mutex,&cond);
             guard.activate(m);
- struct timespec const timeout=detail::get_timespec(wait_until);
             cond_res=pthread_cond_timedwait(&cond,&internal_mutex,&timeout);
         }
         this_thread::interruption_point();
@@ -80,18 +90,18 @@
         }
         if(cond_res)
         {
- boost::throw_exception(condition_error());
+ boost::throw_exception(condition_error(cond_res, "condition_variable failed in pthread_cond_timedwait"));
         }
         return true;
     }
 
- inline void condition_variable::notify_one()
+ inline void condition_variable::notify_one() BOOST_NOEXCEPT
     {
         boost::pthread::pthread_mutex_scoped_lock internal_lock(&internal_mutex);
         BOOST_VERIFY(!pthread_cond_signal(&cond));
     }
 
- inline void condition_variable::notify_all()
+ inline void condition_variable::notify_all() BOOST_NOEXCEPT
     {
         boost::pthread::pthread_mutex_scoped_lock internal_lock(&internal_mutex);
         BOOST_VERIFY(!pthread_cond_broadcast(&cond));
@@ -102,22 +112,20 @@
         pthread_mutex_t internal_mutex;
         pthread_cond_t cond;
 
- condition_variable_any(condition_variable_any&);
- condition_variable_any& operator=(condition_variable_any&);
-
     public:
+ BOOST_THREAD_NO_COPYABLE(condition_variable_any)
         condition_variable_any()
         {
             int const res=pthread_mutex_init(&internal_mutex,NULL);
             if(res)
             {
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "condition_variable_any failed in pthread_mutex_init"));
             }
             int const res2=pthread_cond_init(&cond,NULL);
             if(res2)
             {
                 BOOST_VERIFY(!pthread_mutex_destroy(&internal_mutex));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "condition_variable_any failed in pthread_cond_init"));
             }
         }
         ~condition_variable_any()
@@ -139,7 +147,7 @@
             this_thread::interruption_point();
             if(res)
             {
- boost::throw_exception(condition_error());
+ boost::throw_exception(condition_error(res, "condition_variable_any failed in pthread_cond_wait"));
             }
         }
 
@@ -153,23 +161,7 @@
         bool timed_wait(lock_type& m,boost::system_time const& wait_until)
         {
             struct timespec const timeout=detail::get_timespec(wait_until);
- int res=0;
- {
- thread_cv_detail::lock_on_exit<lock_type> guard;
- detail::interruption_checker check_for_interruption(&internal_mutex,&cond);
- guard.activate(m);
- res=pthread_cond_timedwait(&cond,&internal_mutex,&timeout);
- }
- this_thread::interruption_point();
- if(res==ETIMEDOUT)
- {
- return false;
- }
- if(res)
- {
- boost::throw_exception(condition_error());
- }
- return true;
+ return do_timed_wait(m, timeout);
         }
         template<typename lock_type>
         bool timed_wait(lock_type& m,xtime const& wait_until)
@@ -206,17 +198,134 @@
             return timed_wait(m,get_system_time()+wait_duration,pred);
         }
 
- void notify_one()
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class lock_type,class Duration>
+ cv_status
+ wait_until(
+ lock_type& lock,
+ const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<system_clock, nanoseconds> nano_sys_tmpt;
+ wait_until(lock,
+ nano_sys_tmpt(ceil<nanoseconds>(t.time_since_epoch())));
+ return system_clock::now() < t ? cv_status::no_timeout :
+ cv_status::timeout;
+ }
+
+ template <class lock_type, class Clock, class Duration>
+ cv_status
+ wait_until(
+ lock_type& lock,
+ const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ wait_until(lock, s_now + ceil<nanoseconds>(t - c_now));
+ return Clock::now() < t ? cv_status::no_timeout : cv_status::timeout;
+ }
+
+ template <class lock_type, class Clock, class Duration, class Predicate>
+ bool
+ wait_until(
+ lock_type& lock,
+ const chrono::time_point<Clock, Duration>& t,
+ Predicate pred)
+ {
+ while (!pred())
+ {
+ if (wait_until(lock, t) == cv_status::timeout)
+ return pred();
+ }
+ return true;
+ }
+
+
+ template <class lock_type, class Rep, class Period>
+ cv_status
+ wait_for(
+ lock_type& lock,
+ const chrono::duration<Rep, Period>& d)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ steady_clock::time_point c_now = steady_clock::now();
+ wait_until(lock, s_now + ceil<nanoseconds>(d));
+ return steady_clock::now() - c_now < d ? cv_status::no_timeout :
+ cv_status::timeout;
+
+ }
+
+
+ template <class lock_type, class Rep, class Period, class Predicate>
+ bool
+ wait_for(
+ lock_type& lock,
+ const chrono::duration<Rep, Period>& d,
+ Predicate pred)
+ {
+ while (!pred())
+ {
+ if (wait_for(lock, d) == cv_status::timeout)
+ return pred();
+ }
+ return true;
+ }
+
+ template <class lock_type>
+ inline void wait_until(
+ lock_type& lk,
+ chrono::time_point<chrono::system_clock, chrono::nanoseconds> tp)
+ {
+ using namespace chrono;
+ nanoseconds d = tp.time_since_epoch();
+ timespec ts;
+ seconds s = duration_cast<seconds>(d);
+ ts.tv_sec = static_cast<long>(s.count());
+ ts.tv_nsec = static_cast<long>((d - s).count());
+ do_timed_wait(lk, ts);
+ }
+#endif
+
+ void notify_one() BOOST_NOEXCEPT
         {
             boost::pthread::pthread_mutex_scoped_lock internal_lock(&internal_mutex);
             BOOST_VERIFY(!pthread_cond_signal(&cond));
         }
 
- void notify_all()
+ void notify_all() BOOST_NOEXCEPT
         {
             boost::pthread::pthread_mutex_scoped_lock internal_lock(&internal_mutex);
             BOOST_VERIFY(!pthread_cond_broadcast(&cond));
         }
+ private: // used by boost::thread::try_join_until
+
+ template <class lock_type>
+ inline bool do_timed_wait(
+ lock_type& m,
+ struct timespec const &timeout)
+ {
+ int res=0;
+ {
+ thread_cv_detail::lock_on_exit<lock_type> guard;
+ detail::interruption_checker check_for_interruption(&internal_mutex,&cond);
+ guard.activate(m);
+ res=pthread_cond_timedwait(&cond,&internal_mutex,&timeout);
+ }
+ this_thread::interruption_point();
+ if(res==ETIMEDOUT)
+ {
+ return false;
+ }
+ if(res)
+ {
+ boost::throw_exception(condition_error(res, "condition_variable_any failed in pthread_cond_timedwait"));
+ }
+ return true;
+ }
+
+
     };
 
 }

Modified: branches/release/boost/thread/pthread/condition_variable_fwd.hpp
==============================================================================
--- branches/release/boost/thread/pthread/condition_variable_fwd.hpp (original)
+++ branches/release/boost/thread/pthread/condition_variable_fwd.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -4,41 +4,47 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011 Vicente J. Botet Escriba
 
 #include <boost/assert.hpp>
 #include <boost/throw_exception.hpp>
 #include <pthread.h>
+#include <boost/thread/cv_status.hpp>
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/locks.hpp>
 #include <boost/thread/thread_time.hpp>
 #include <boost/thread/xtime.hpp>
-
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
+#include <boost/thread/detail/delete.hpp>
+#include <boost/date_time/posix_time/posix_time_duration.hpp>
 #include <boost/config/abi_prefix.hpp>
 
 namespace boost
 {
+
     class condition_variable
     {
     private:
         pthread_mutex_t internal_mutex;
         pthread_cond_t cond;
 
- condition_variable(condition_variable&);
- condition_variable& operator=(condition_variable&);
-
     public:
+ BOOST_THREAD_NO_COPYABLE(condition_variable)
         condition_variable()
         {
             int const res=pthread_mutex_init(&internal_mutex,NULL);
             if(res)
             {
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: condition_variable constructor failed in pthread_mutex_init"));
             }
             int const res2=pthread_cond_init(&cond,NULL);
             if(res2)
             {
                 BOOST_VERIFY(!pthread_mutex_destroy(&internal_mutex));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res2, "boost:: condition_variable constructor failed in pthread_cond_init"));
             }
         }
         ~condition_variable()
@@ -59,21 +65,38 @@
             while(!pred()) wait(m);
         }
 
- inline bool timed_wait(unique_lock<mutex>& m,
- boost::system_time const& wait_until);
- bool timed_wait(unique_lock<mutex>& m,xtime const& wait_until)
+
+ inline bool timed_wait(
+ unique_lock<mutex>& m,
+ boost::system_time const& wait_until)
+ {
+#if defined BOOST_THREAD_WAIT_BUG
+ struct timespec const timeout=detail::get_timespec(wait_until + BOOST_THREAD_WAIT_BUG);
+ return do_timed_wait(m, timeout);
+#else
+ struct timespec const timeout=detail::get_timespec(wait_until);
+ return do_timed_wait(m, timeout);
+#endif
+ }
+ bool timed_wait(
+ unique_lock<mutex>& m,
+ xtime const& wait_until)
         {
             return timed_wait(m,system_time(wait_until));
         }
 
         template<typename duration_type>
- bool timed_wait(unique_lock<mutex>& m,duration_type const& wait_duration)
+ bool timed_wait(
+ unique_lock<mutex>& m,
+ duration_type const& wait_duration)
         {
             return timed_wait(m,get_system_time()+wait_duration);
         }
 
         template<typename predicate_type>
- bool timed_wait(unique_lock<mutex>& m,boost::system_time const& wait_until,predicate_type pred)
+ bool timed_wait(
+ unique_lock<mutex>& m,
+ boost::system_time const& wait_until,predicate_type pred)
         {
             while (!pred())
             {
@@ -84,25 +107,127 @@
         }
 
         template<typename predicate_type>
- bool timed_wait(unique_lock<mutex>& m,xtime const& wait_until,predicate_type pred)
+ bool timed_wait(
+ unique_lock<mutex>& m,
+ xtime const& wait_until,predicate_type pred)
         {
             return timed_wait(m,system_time(wait_until),pred);
         }
 
         template<typename duration_type,typename predicate_type>
- bool timed_wait(unique_lock<mutex>& m,duration_type const& wait_duration,predicate_type pred)
+ bool timed_wait(
+ unique_lock<mutex>& m,
+ duration_type const& wait_duration,predicate_type pred)
         {
             return timed_wait(m,get_system_time()+wait_duration,pred);
         }
 
+#ifdef BOOST_THREAD_USES_CHRONO
+
+ template <class Duration>
+ cv_status
+ wait_until(
+ unique_lock<mutex>& lock,
+ const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<system_clock, nanoseconds> nano_sys_tmpt;
+ wait_until(lock,
+ nano_sys_tmpt(ceil<nanoseconds>(t.time_since_epoch())));
+ return system_clock::now() < t ? cv_status::no_timeout :
+ cv_status::timeout;
+ }
+
+ template <class Clock, class Duration>
+ cv_status
+ wait_until(
+ unique_lock<mutex>& lock,
+ const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ wait_until(lock, s_now + ceil<nanoseconds>(t - c_now));
+ return Clock::now() < t ? cv_status::no_timeout : cv_status::timeout;
+ }
+
+ template <class Clock, class Duration, class Predicate>
+ bool
+ wait_until(
+ unique_lock<mutex>& lock,
+ const chrono::time_point<Clock, Duration>& t,
+ Predicate pred)
+ {
+ while (!pred())
+ {
+ if (wait_until(lock, t) == cv_status::timeout)
+ return pred();
+ }
+ return true;
+ }
+
+
+ template <class Rep, class Period>
+ cv_status
+ wait_for(
+ unique_lock<mutex>& lock,
+ const chrono::duration<Rep, Period>& d)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ steady_clock::time_point c_now = steady_clock::now();
+ wait_until(lock, s_now + ceil<nanoseconds>(d));
+ return steady_clock::now() - c_now < d ? cv_status::no_timeout :
+ cv_status::timeout;
+
+ }
+
+
+ template <class Rep, class Period, class Predicate>
+ bool
+ wait_for(
+ unique_lock<mutex>& lock,
+ const chrono::duration<Rep, Period>& d,
+ Predicate pred)
+ {
+ while (!pred())
+ {
+ if (wait_for(lock, d) == cv_status::timeout)
+ return pred();
+ }
+ return true;
+ }
+#endif
+
+#define BOOST_THREAD_DEFINES_CONDITION_VARIABLE_NATIVE_HANDLE
         typedef pthread_cond_t* native_handle_type;
         native_handle_type native_handle()
         {
             return &cond;
         }
 
- void notify_one();
- void notify_all();
+ void notify_one() BOOST_NOEXCEPT;
+ void notify_all() BOOST_NOEXCEPT;
+
+#ifdef BOOST_THREAD_USES_CHRONO
+ inline void wait_until(
+ unique_lock<mutex>& lk,
+ chrono::time_point<chrono::system_clock, chrono::nanoseconds> tp)
+ {
+ using namespace chrono;
+ nanoseconds d = tp.time_since_epoch();
+ timespec ts;
+ seconds s = duration_cast<seconds>(d);
+ ts.tv_sec = static_cast<long>(s.count());
+ ts.tv_nsec = static_cast<long>((d - s).count());
+ do_timed_wait(lk, ts);
+ }
+#endif
+ //private: // used by boost::thread::try_join_until
+
+ inline bool do_timed_wait(
+ unique_lock<mutex>& lock,
+ struct timespec const &timeout);
     };
 }
 

Modified: branches/release/boost/thread/pthread/mutex.hpp
==============================================================================
--- branches/release/boost/thread/pthread/mutex.hpp (original)
+++ branches/release/boost/thread/pthread/mutex.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,12 +1,12 @@
 #ifndef BOOST_THREAD_PTHREAD_MUTEX_HPP
 #define BOOST_THREAD_PTHREAD_MUTEX_HPP
 // (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-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)
 
 #include <pthread.h>
-#include <boost/utility.hpp>
 #include <boost/throw_exception.hpp>
 #include <boost/thread/exceptions.hpp>
 #include <boost/thread/locks.hpp>
@@ -16,6 +16,11 @@
 #include <errno.h>
 #include <boost/thread/pthread/timespec.hpp>
 #include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
+#include <boost/thread/detail/delete.hpp>
 
 #ifdef _POSIX_TIMEOUTS
 #if _POSIX_TIMEOUTS >= 0 && _POSIX_C_SOURCE>=200112L
@@ -30,16 +35,16 @@
     class mutex
     {
     private:
- mutex(mutex const&);
- mutex& operator=(mutex const&);
         pthread_mutex_t m;
     public:
+ BOOST_THREAD_NO_COPYABLE(mutex)
+
         mutex()
         {
             int const res=pthread_mutex_init(&m,NULL);
             if(res)
             {
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: mutex constructor failed in pthread_mutex_init"));
             }
         }
         ~mutex()
@@ -58,9 +63,9 @@
             {
                 res = pthread_mutex_lock(&m);
             } while (res == EINTR);
- if(res)
+ if (res)
             {
- boost::throw_exception(lock_error(res));
+ boost::throw_exception(lock_error(res,"boost: mutex lock failed in pthread_mutex_lock"));
             }
         }
 
@@ -83,12 +88,17 @@
             } while (res == EINTR);
             if(res && (res!=EBUSY))
             {
- boost::throw_exception(lock_error(res));
+ // The following throw_exception has been replaced by an assertion and just return false,
+ // as this is an internal error and the user can do nothing with the exception.
+ //boost::throw_exception(lock_error(res,"boost: mutex try_lock failed in pthread_mutex_trylock"));
+ BOOST_ASSERT_MSG(false ,"boost: mutex try_lock failed in pthread_mutex_trylock");
+ return false;
             }
 
             return !res;
         }
 
+#define BOOST_THREAD_DEFINES_MUTEX_NATIVE_HANDLE
         typedef pthread_mutex_t* native_handle_type;
         native_handle_type native_handle()
         {
@@ -104,28 +114,26 @@
     class timed_mutex
     {
     private:
- timed_mutex(timed_mutex const&);
- timed_mutex& operator=(timed_mutex const&);
- private:
         pthread_mutex_t m;
 #ifndef BOOST_PTHREAD_HAS_TIMEDLOCK
         pthread_cond_t cond;
         bool is_locked;
 #endif
     public:
+ BOOST_THREAD_NO_COPYABLE(timed_mutex)
         timed_mutex()
         {
             int const res=pthread_mutex_init(&m,NULL);
             if(res)
             {
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: timed_mutex constructor failed in pthread_mutex_init"));
             }
 #ifndef BOOST_PTHREAD_HAS_TIMEDLOCK
             int const res2=pthread_cond_init(&cond,NULL);
             if(res2)
             {
                 BOOST_VERIFY(!pthread_mutex_destroy(&m));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res2, "boost:: timed_mutex constructor failed in pthread_cond_init"));
             }
             is_locked=false;
 #endif
@@ -165,19 +173,16 @@
             BOOST_ASSERT(!res || res==EBUSY);
             return !res;
         }
- bool timed_lock(system_time const & abs_time)
- {
- struct timespec const timeout=detail::get_timespec(abs_time);
- int const res=pthread_mutex_timedlock(&m,&timeout);
- BOOST_ASSERT(!res || res==ETIMEDOUT);
- return !res;
- }
 
- typedef pthread_mutex_t* native_handle_type;
- native_handle_type native_handle()
+
+ private:
+ bool do_try_lock_until(struct timespec const &timeout)
         {
- return &m;
+ int const res=pthread_mutex_timedlock(&m,&timeout);
+ BOOST_ASSERT(!res || res==ETIMEDOUT);
+ return !res;
         }
+ public:
 
 #else
         void lock()
@@ -208,9 +213,9 @@
             return true;
         }
 
- bool timed_lock(system_time const & abs_time)
+ private:
+ bool do_try_lock_until(struct timespec const &timeout)
         {
- struct timespec const timeout=detail::get_timespec(abs_time);
             boost::pthread::pthread_mutex_scoped_lock const local_lock(&m);
             while(is_locked)
             {
@@ -224,8 +229,55 @@
             is_locked=true;
             return true;
         }
+ public:
+#endif
+
+ bool timed_lock(system_time const & abs_time)
+ {
+ struct timespec const ts=detail::get_timespec(abs_time);
+ return do_try_lock_until(ts);
+ }
+
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ return try_lock_until(s_now + ceil<nanoseconds>(t - c_now));
+ }
+ template <class Duration>
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<system_clock, nanoseconds> nano_sys_tmpt;
+ return try_lock_until(nano_sys_tmpt(ceil<nanoseconds>(t.time_since_epoch())));
+ }
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, chrono::nanoseconds>& tp)
+ {
+ using namespace chrono;
+ nanoseconds d = tp.time_since_epoch();
+ timespec ts;
+ seconds s = duration_cast<seconds>(d);
+ ts.tv_sec = static_cast<long>(s.count());
+ ts.tv_nsec = static_cast<long>((d - s).count());
+ return do_try_lock_until(ts);
+ }
 #endif
 
+#define BOOST_THREAD_DEFINES_TIMED_MUTEX_NATIVE_HANDLE
+ typedef pthread_mutex_t* native_handle_type;
+ native_handle_type native_handle()
+ {
+ return &m;
+ }
+
         typedef unique_lock<timed_mutex> scoped_timed_lock;
         typedef detail::try_lock_wrapper<timed_mutex> scoped_try_lock;
         typedef scoped_timed_lock scoped_lock;

Modified: branches/release/boost/thread/pthread/once.hpp
==============================================================================
--- branches/release/boost/thread/pthread/once.hpp (original)
+++ branches/release/boost/thread/pthread/once.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -4,29 +4,52 @@
 // once.hpp
 //
 // (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-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)
 
 #include <boost/thread/detail/config.hpp>
-#include <boost/config.hpp>
 
 #include <pthread.h>
 #include <boost/assert.hpp>
 #include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
 #include <boost/cstdint.hpp>
+#include <boost/thread/detail/delete.hpp>
 
 #include <boost/config/abi_prefix.hpp>
 
 namespace boost
 {
 
+#define BOOST_ONCE_INITIAL_FLAG_VALUE 0
+
+#ifdef BOOST_THREAD_PROVIDES_ONCE_CXX11
+
+ struct once_flag
+ {
+ BOOST_THREAD_NO_COPYABLE(once_flag)
+ BOOST_CONSTEXPR once_flag() BOOST_NOEXCEPT
+ : epoch(BOOST_ONCE_INITIAL_FLAG_VALUE)
+ {}
+ private:
+ boost::uintmax_t epoch;
+ template<typename Function>
+ friend
+ void call_once(once_flag& flag,Function f);
+ };
+
+#else // BOOST_THREAD_PROVIDES_ONCE_CXX11
+
     struct once_flag
     {
         boost::uintmax_t epoch;
     };
 
+#define BOOST_ONCE_INIT {BOOST_ONCE_INITIAL_FLAG_VALUE}
+#endif // BOOST_THREAD_PROVIDES_ONCE_CXX11
+
     namespace detail
     {
         BOOST_THREAD_DECL boost::uintmax_t& get_once_per_thread_epoch();
@@ -35,10 +58,6 @@
         BOOST_THREAD_DECL extern pthread_cond_t once_epoch_cv;
     }
 
-#define BOOST_ONCE_INITIAL_FLAG_VALUE 0
-#define BOOST_ONCE_INIT {BOOST_ONCE_INITIAL_FLAG_VALUE}
-
-
     // Based on Mike Burrows fast_pthread_once algorithm as described in
     // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2444.html
     template<typename Function>

Modified: branches/release/boost/thread/pthread/recursive_mutex.hpp
==============================================================================
--- branches/release/boost/thread/pthread/recursive_mutex.hpp (original)
+++ branches/release/boost/thread/pthread/recursive_mutex.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,12 +1,12 @@
 #ifndef BOOST_THREAD_PTHREAD_RECURSIVE_MUTEX_HPP
 #define BOOST_THREAD_PTHREAD_RECURSIVE_MUTEX_HPP
 // (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-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)
 
 #include <pthread.h>
-#include <boost/utility.hpp>
 #include <boost/throw_exception.hpp>
 #include <boost/thread/exceptions.hpp>
 #include <boost/thread/locks.hpp>
@@ -19,6 +19,11 @@
 #include <errno.h>
 #include <boost/thread/pthread/timespec.hpp>
 #include <boost/thread/pthread/pthread_mutex_scoped_lock.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
+#include <boost/thread/detail/delete.hpp>
 
 #ifdef _POSIX_TIMEOUTS
 #if _POSIX_TIMEOUTS >= 0
@@ -37,8 +42,6 @@
     class recursive_mutex
     {
     private:
- recursive_mutex(recursive_mutex const&);
- recursive_mutex& operator=(recursive_mutex const&);
         pthread_mutex_t m;
 #ifndef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
         pthread_cond_t cond;
@@ -47,6 +50,7 @@
         unsigned count;
 #endif
     public:
+ BOOST_THREAD_NO_COPYABLE(recursive_mutex)
         recursive_mutex()
         {
 #ifdef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
@@ -55,33 +59,33 @@
             int const init_attr_res=pthread_mutexattr_init(&attr);
             if(init_attr_res)
             {
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(init_attr_res, "boost:: recursive_mutex constructor failed in pthread_mutexattr_init"));
             }
             int const set_attr_res=pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE);
             if(set_attr_res)
             {
                 BOOST_VERIFY(!pthread_mutexattr_destroy(&attr));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(set_attr_res, "boost:: recursive_mutex constructor failed in pthread_mutexattr_settype"));
             }
 
             int const res=pthread_mutex_init(&m,&attr);
             if(res)
             {
                 BOOST_VERIFY(!pthread_mutexattr_destroy(&attr));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: recursive_mutex constructor failed in pthread_mutex_init"));
             }
             BOOST_VERIFY(!pthread_mutexattr_destroy(&attr));
 #else
             int const res=pthread_mutex_init(&m,NULL);
             if(res)
             {
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: recursive_mutex constructor failed in pthread_mutex_init"));
             }
             int const res2=pthread_cond_init(&cond,NULL);
             if(res2)
             {
                 BOOST_VERIFY(!pthread_mutex_destroy(&m));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res2, "boost:: recursive_mutex constructor failed in pthread_cond_init"));
             }
             is_locked=false;
             count=0;
@@ -112,6 +116,7 @@
             BOOST_ASSERT(!res || res==EBUSY);
             return !res;
         }
+#define BOOST_THREAD_DEFINES_RECURSIVE_MUTEX_NATIVE_HANDLE
         typedef pthread_mutex_t* native_handle_type;
         native_handle_type native_handle()
         {
@@ -171,9 +176,6 @@
     class recursive_timed_mutex
     {
     private:
- recursive_timed_mutex(recursive_timed_mutex const&);
- recursive_timed_mutex& operator=(recursive_timed_mutex const&);
- private:
         pthread_mutex_t m;
 #ifndef BOOST_USE_PTHREAD_RECURSIVE_TIMEDLOCK
         pthread_cond_t cond;
@@ -182,6 +184,7 @@
         unsigned count;
 #endif
     public:
+ BOOST_THREAD_NO_COPYABLE(recursive_timed_mutex)
         recursive_timed_mutex()
         {
 #ifdef BOOST_USE_PTHREAD_RECURSIVE_TIMEDLOCK
@@ -190,32 +193,32 @@
             int const init_attr_res=pthread_mutexattr_init(&attr);
             if(init_attr_res)
             {
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(init_attr_res, "boost:: recursive_timed_mutex constructor failed in pthread_mutexattr_init"));
             }
             int const set_attr_res=pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE);
             if(set_attr_res)
             {
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(set_attr_res, "boost:: recursive_timed_mutex constructor failed in pthread_mutexattr_settype"));
             }
 
             int const res=pthread_mutex_init(&m,&attr);
             if(res)
             {
                 BOOST_VERIFY(!pthread_mutexattr_destroy(&attr));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: recursive_timed_mutex constructor failed in pthread_mutex_init"));
             }
             BOOST_VERIFY(!pthread_mutexattr_destroy(&attr));
 #else
             int const res=pthread_mutex_init(&m,NULL);
             if(res)
             {
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost:: recursive_timed_mutex constructor failed in pthread_mutex_init"));
             }
             int const res2=pthread_cond_init(&cond,NULL);
             if(res2)
             {
                 BOOST_VERIFY(!pthread_mutex_destroy(&m));
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res2, "boost:: recursive_timed_mutex constructor failed in pthread_cond_init"));
             }
             is_locked=false;
             count=0;
@@ -252,19 +255,15 @@
             BOOST_ASSERT(!res || res==EBUSY);
             return !res;
         }
- bool timed_lock(system_time const & abs_time)
+ private:
+ bool do_try_lock_until(struct timespec const &timeout)
         {
- struct timespec const timeout=detail::get_timespec(abs_time);
             int const res=pthread_mutex_timedlock(&m,&timeout);
             BOOST_ASSERT(!res || res==ETIMEDOUT);
             return !res;
         }
 
- typedef pthread_mutex_t* native_handle_type;
- native_handle_type native_handle()
- {
- return &m;
- }
+ public:
 
 #else
         void lock()
@@ -308,9 +307,9 @@
             return true;
         }
 
- bool timed_lock(system_time const & abs_time)
+ private:
+ bool do_try_lock_until(struct timespec const &timeout)
         {
- struct timespec const timeout=detail::get_timespec(abs_time);
             boost::pthread::pthread_mutex_scoped_lock const local_lock(&m);
             if(is_locked && pthread_equal(owner,pthread_self()))
             {
@@ -331,8 +330,56 @@
             owner=pthread_self();
             return true;
         }
+ public:
+
+#endif
+
+ bool timed_lock(system_time const & abs_time)
+ {
+ struct timespec const ts=detail::get_timespec(abs_time);
+ return do_try_lock_until(ts);
+ }
+
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ return try_lock_until(s_now + ceil<nanoseconds>(t - c_now));
+ }
+ template <class Duration>
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<system_clock, nanoseconds> nano_sys_tmpt;
+ return try_lock_until(nano_sys_tmpt(ceil<nanoseconds>(t.time_since_epoch())));
+ }
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, chrono::nanoseconds>& tp)
+ {
+ using namespace chrono;
+ nanoseconds d = tp.time_since_epoch();
+ timespec ts;
+ seconds s = duration_cast<seconds>(d);
+ ts.tv_sec = static_cast<long>(s.count());
+ ts.tv_nsec = static_cast<long>((d - s).count());
+ return do_try_lock_until(ts);
+ }
 #endif
 
+#define BOOST_THREAD_DEFINES_RECURSIVE_TIMED_MUTEX_NATIVE_HANDLE
+ typedef pthread_mutex_t* native_handle_type;
+ native_handle_type native_handle()
+ {
+ return &m;
+ }
+
         typedef unique_lock<recursive_timed_mutex> scoped_timed_lock;
         typedef detail::try_lock_wrapper<recursive_timed_mutex> scoped_try_lock;
         typedef scoped_timed_lock scoped_lock;

Modified: branches/release/boost/thread/pthread/shared_mutex.hpp
==============================================================================
--- branches/release/boost/thread/pthread/shared_mutex.hpp (original)
+++ branches/release/boost/thread/pthread/shared_mutex.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -2,6 +2,7 @@
 #define BOOST_THREAD_PTHREAD_SHARED_MUTEX_HPP
 
 // (C) Copyright 2006-8 Anthony Williams
+// (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
@@ -12,6 +13,11 @@
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/condition_variable.hpp>
 #include <boost/thread/detail/thread_interruption.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
+#include <boost/thread/detail/delete.hpp>
 
 #include <boost/config/abi_prefix.hpp>
 
@@ -42,8 +48,9 @@
             shared_cond.notify_all();
         }
 
-
     public:
+ BOOST_THREAD_NO_COPYABLE(shared_mutex)
+
         shared_mutex()
         {
             state_data state_={0,0,0,0};
@@ -102,7 +109,29 @@
         {
             return timed_lock_shared(get_system_time()+relative_time);
         }
-
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_shared_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_shared_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_shared_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::this_thread::disable_interruption do_not_disturb;
+ boost::mutex::scoped_lock lk(state_change);
+
+ while(state.exclusive || state.exclusive_waiting_blocked)
+ {
+ if(cv_status::timeout==shared_cond.wait_until(lk,abs_time))
+ {
+ return false;
+ }
+ }
+ ++state.shared_count;
+ return true;
+ }
+#endif
         void unlock_shared()
         {
             boost::mutex::scoped_lock lk(state_change);
@@ -166,6 +195,37 @@
             return timed_lock(get_system_time()+relative_time);
         }
 
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::this_thread::disable_interruption do_not_disturb;
+ boost::mutex::scoped_lock lk(state_change);
+
+ while(state.shared_count || state.exclusive)
+ {
+ state.exclusive_waiting_blocked=true;
+ if(cv_status::timeout == exclusive_cond.wait_until(lk,abs_time))
+ {
+ if(state.shared_count || state.exclusive)
+ {
+ state.exclusive_waiting_blocked=false;
+ release_waiters();
+ return false;
+ }
+ break;
+ }
+ }
+ state.exclusive=true;
+ return true;
+ }
+#endif
+
         bool try_lock()
         {
             boost::mutex::scoped_lock lk(state_change);
@@ -228,6 +288,33 @@
             return timed_lock_upgrade(get_system_time()+relative_time);
         }
 
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_upgrade_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_upgrade_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_upgrade_until(const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::this_thread::disable_interruption do_not_disturb;
+ boost::mutex::scoped_lock lk(state_change);
+ while(state.exclusive || state.exclusive_waiting_blocked || state.upgrade)
+ {
+ if(cv_status::timeout == shared_cond.wait_until(lk,abs_time))
+ {
+ if(state.exclusive || state.exclusive_waiting_blocked || state.upgrade)
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ ++state.shared_count;
+ state.upgrade=true;
+ return true;
+ }
+#endif
         bool try_lock_upgrade()
         {
             boost::mutex::scoped_lock lk(state_change);
@@ -253,9 +340,12 @@
             {
                 state.exclusive_waiting_blocked=false;
                 release_waiters();
+ } else {
+ shared_cond.notify_all();
             }
         }
 
+ // Upgrade <-> Exclusive
         void unlock_upgrade_and_lock()
         {
             boost::this_thread::disable_interruption do_not_disturb;
@@ -279,6 +369,57 @@
             release_waiters();
         }
 
+ bool try_unlock_upgrade_and_lock()
+ {
+ boost::mutex::scoped_lock lk(state_change);
+ if( !state.exclusive
+ && !state.exclusive_waiting_blocked
+ && state.upgrade
+ && state.shared_count==1)
+ {
+ state.shared_count=0;
+ state.exclusive=true;
+ state.upgrade=false;
+ return true;
+ }
+ return false;
+ }
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool
+ try_unlock_upgrade_and_lock_for(
+ const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_unlock_upgrade_and_lock_until(
+ chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool
+ try_unlock_upgrade_and_lock_until(
+ const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::this_thread::disable_interruption do_not_disturb;
+ boost::mutex::scoped_lock lk(state_change);
+ if (state.shared_count != 1)
+ {
+ for (;;)
+ {
+ cv_status status = shared_cond.wait_until(lk,abs_time);
+ if (state.shared_count == 1)
+ break;
+ if(status == cv_status::timeout)
+ return false;
+ }
+ }
+ state.upgrade=false;
+ state.exclusive=true;
+ state.exclusive_waiting_blocked=false;
+ state.shared_count=0;
+ return true;
+ }
+#endif
+
+ // Shared <-> Exclusive
         void unlock_and_lock_shared()
         {
             boost::mutex::scoped_lock lk(state_change);
@@ -288,6 +429,58 @@
             release_waiters();
         }
 
+#ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+ bool try_unlock_shared_and_lock()
+ {
+ boost::mutex::scoped_lock lk(state_change);
+ if( !state.exclusive
+ && !state.exclusive_waiting_blocked
+ && !state.upgrade
+ && state.shared_count==1)
+ {
+ state.shared_count=0;
+ state.exclusive=true;
+ return true;
+ }
+ return false;
+ }
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool
+ try_unlock_shared_and_lock_for(
+ const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_unlock_shared_and_lock_until(
+ chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool
+ try_unlock_shared_and_lock_until(
+ const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::this_thread::disable_interruption do_not_disturb;
+ boost::mutex::scoped_lock lk(state_change);
+ if (state.shared_count != 1)
+ {
+ for (;;)
+ {
+ cv_status status = shared_cond.wait_until(lk,abs_time);
+ if (state.shared_count == 1)
+ break;
+ if(status == cv_status::timeout)
+ return false;
+ }
+ }
+ state.upgrade=false;
+ state.exclusive=true;
+ state.exclusive_waiting_blocked=false;
+ state.shared_count=0;
+ return true;
+ }
+#endif
+#endif
+
+ // Shared <-> Upgrade
         void unlock_upgrade_and_lock_shared()
         {
             boost::mutex::scoped_lock lk(state_change);
@@ -295,7 +488,62 @@
             state.exclusive_waiting_blocked=false;
             release_waiters();
         }
+
+#ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+ bool try_unlock_shared_and_lock_upgrade()
+ {
+ boost::mutex::scoped_lock lk(state_change);
+ if( !state.exclusive
+ && !state.exclusive_waiting_blocked
+ && !state.upgrade
+ )
+ {
+ state.upgrade=true;
+ return true;
+ }
+ return false;
+ }
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool
+ try_unlock_shared_and_lock_upgrade_for(
+ const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_unlock_shared_and_lock_upgrade_until(
+ chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool
+ try_unlock_shared_and_lock_upgrade_until(
+ const chrono::time_point<Clock, Duration>& abs_time)
+ {
+ boost::this_thread::disable_interruption do_not_disturb;
+ boost::mutex::scoped_lock lk(state_change);
+ if( state.exclusive
+ || state.exclusive_waiting_blocked
+ || state.upgrade
+ )
+ {
+ for (;;)
+ {
+ cv_status status = exclusive_cond.wait_until(lk,abs_time);
+ if( ! state.exclusive
+ && ! state.exclusive_waiting_blocked
+ && ! state.upgrade
+ )
+ break;
+ if(status == cv_status::timeout)
+ return false;
+ }
+ }
+ state.upgrade=true;
+ return true;
+ }
+#endif
+#endif
     };
+
+ typedef shared_mutex upgrade_mutex;
 }
 
 #include <boost/config/abi_suffix.hpp>

Modified: branches/release/boost/thread/pthread/thread_data.hpp
==============================================================================
--- branches/release/boost/thread/pthread/thread_data.hpp (original)
+++ branches/release/boost/thread/pthread/thread_data.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -4,6 +4,7 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2007 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 
 #include <boost/thread/detail/config.hpp>
 #include <boost/thread/exceptions.hpp>
@@ -15,11 +16,56 @@
 #include <boost/assert.hpp>
 #include <boost/thread/pthread/condition_variable_fwd.hpp>
 #include <map>
-
+#include <unistd.h>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#endif
 #include <boost/config/abi_prefix.hpp>
 
 namespace boost
 {
+ class thread_attributes {
+ public:
+ thread_attributes() BOOST_NOEXCEPT {
+ int res = pthread_attr_init(&val_);
+ BOOST_VERIFY(!res && "pthread_attr_init failed");
+ }
+ ~thread_attributes() {
+ int res = pthread_attr_destroy(&val_);
+ BOOST_VERIFY(!res && "pthread_attr_destroy failed");
+ }
+ // stack
+ void set_stack_size(std::size_t size) BOOST_NOEXCEPT {
+ if (size==0) return;
+ std::size_t page_size = getpagesize();
+#ifdef PTHREAD_STACK_MIN
+ if (size<PTHREAD_STACK_MIN) size=PTHREAD_STACK_MIN;
+#endif
+ size = ((size+page_size-1)/page_size)*page_size;
+ int res = pthread_attr_setstacksize(&val_, size);
+ BOOST_VERIFY(!res && "pthread_attr_setstacksize failed");
+ }
+
+ std::size_t get_stack_size() const BOOST_NOEXCEPT {
+ std::size_t size;
+ int res = pthread_attr_getstacksize(&val_, &size);
+ BOOST_VERIFY(!res && "pthread_attr_getstacksize failed");
+ return size;
+ }
+#define BOOST_THREAD_DEFINES_THREAD_ATTRIBUTES_NATIVE_HANDLE
+
+ typedef pthread_attr_t native_handle_type;
+ native_handle_type* native_handle() BOOST_NOEXCEPT {
+ return &val_;
+ }
+ const native_handle_type* native_handle() const BOOST_NOEXCEPT {
+ return &val_;
+ }
+
+ private:
+ pthread_attr_t val_;
+ };
+
     class thread;
 
     namespace detail
@@ -128,7 +174,10 @@
 
     namespace this_thread
     {
- void BOOST_THREAD_DECL yield();
+#ifdef BOOST_THREAD_USES_CHRONO
+ void BOOST_SYMBOL_VISIBLE sleep_for(const chrono::nanoseconds& ns);
+#endif
+ void BOOST_THREAD_DECL yield() BOOST_NOEXCEPT;
 
 #ifdef __DECXXX
         /// Workaround of DECCXX issue of incorrect template substitution

Modified: branches/release/boost/thread/shared_mutex.hpp
==============================================================================
--- branches/release/boost/thread/shared_mutex.hpp (original)
+++ branches/release/boost/thread/shared_mutex.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -3,15 +3,20 @@
 
 // shared_mutex.hpp
 //
-// (C) Copyright 2007 Anthony Williams
+// (C) Copyright 2007 Anthony Williams
+// (C) Copyright 2011-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)
 
-#include <boost/thread/detail/platform.hpp>
+#include <boost/thread/detail/config.hpp>
 #if defined(BOOST_THREAD_PLATFORM_WIN32)
+#if defined(BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN)
+#include <boost/thread/pthread/shared_mutex.hpp>
+#else
 #include <boost/thread/win32/shared_mutex.hpp>
+#endif
 #elif defined(BOOST_THREAD_PLATFORM_PTHREAD)
 #include <boost/thread/pthread/shared_mutex.hpp>
 #else

Modified: branches/release/boost/thread/thread.hpp
==============================================================================
--- branches/release/boost/thread/thread.hpp (original)
+++ branches/release/boost/thread/thread.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -3,7 +3,7 @@
 
 // thread.hpp
 //
-// (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2007-8 Anthony Williams
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -22,6 +22,7 @@
 #include <boost/thread/detail/thread.hpp>
 #include <boost/thread/detail/thread_interruption.hpp>
 #include <boost/thread/detail/thread_group.hpp>
+#include <boost/thread/v2/thread.hpp>
 
 
 #endif

Modified: branches/release/boost/thread/win32/basic_recursive_mutex.hpp
==============================================================================
--- branches/release/boost/thread/win32/basic_recursive_mutex.hpp (original)
+++ branches/release/boost/thread/win32/basic_recursive_mutex.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -4,6 +4,7 @@
 // basic_recursive_mutex.hpp
 //
 // (C) Copyright 2006-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -11,6 +12,10 @@
 
 #include <boost/thread/win32/thread_primitives.hpp>
 #include <boost/thread/win32/basic_timed_mutex.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
 
 #include <boost/config/abi_prefix.hpp>
 
@@ -64,6 +69,20 @@
                 return timed_lock(get_system_time()+timeout);
             }
 
+#ifdef BOOST_THREAD_USES_CHRONO
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ long const current_thread_id=win32::GetCurrentThreadId();
+ return try_recursive_lock(current_thread_id) || try_timed_lock_for(current_thread_id,rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ long const current_thread_id=win32::GetCurrentThreadId();
+ return try_recursive_lock(current_thread_id) || try_timed_lock_until(current_thread_id,t);
+ }
+#endif
             void unlock()
             {
                 if(!--recursion_count)
@@ -105,7 +124,28 @@
                 }
                 return false;
             }
-
+ template <typename TP>
+ bool try_timed_lock_until(long current_thread_id,TP const& target)
+ {
+ if(mutex.try_lock_until(target))
+ {
+ BOOST_INTERLOCKED_EXCHANGE(&locking_thread_id,current_thread_id);
+ recursion_count=1;
+ return true;
+ }
+ return false;
+ }
+ template <typename D>
+ bool try_timed_lock_for(long current_thread_id,D const& target)
+ {
+ if(mutex.try_lock_for(target))
+ {
+ BOOST_INTERLOCKED_EXCHANGE(&locking_thread_id,current_thread_id);
+ recursion_count=1;
+ return true;
+ }
+ return false;
+ }
         };
 
         typedef basic_recursive_mutex_impl<basic_timed_mutex> basic_recursive_mutex;

Modified: branches/release/boost/thread/win32/basic_timed_mutex.hpp
==============================================================================
--- branches/release/boost/thread/win32/basic_timed_mutex.hpp (original)
+++ branches/release/boost/thread/win32/basic_timed_mutex.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -4,6 +4,7 @@
 // basic_timed_mutex_win32.hpp
 //
 // (C) Copyright 2006-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -15,7 +16,10 @@
 #include <boost/thread/thread_time.hpp>
 #include <boost/thread/xtime.hpp>
 #include <boost/detail/interlocked.hpp>
-
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
 #include <boost/config/abi_prefix.hpp>
 
 namespace boost
@@ -143,6 +147,7 @@
                 return true;
             }
 
+
             template<typename Duration>
             bool timed_lock(Duration const& timeout)
             {
@@ -154,6 +159,57 @@
                 return timed_lock(system_time(timeout));
             }
 
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ return try_lock_until(s_now + ceil<system_clock::duration>(t - c_now));
+ }
+ template <class Duration>
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<chrono::system_clock, chrono::system_clock::duration> sys_tmpt;
+ return try_lock_until(sys_tmpt(chrono::ceil<chrono::system_clock::duration>(t.time_since_epoch())));
+ }
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, chrono::system_clock::duration>& tp)
+ {
+ if(try_lock())
+ {
+ return true;
+ }
+ long old_count=active_count;
+ mark_waiting_and_try_lock(old_count);
+
+ if(old_count&lock_flag_value)
+ {
+ bool lock_acquired=false;
+ void* const sem=get_event();
+
+ do
+ {
+ chrono::milliseconds rel_time= chrono::ceil<chrono::milliseconds>(tp-chrono::system_clock::now());
+
+ if(win32::WaitForSingleObject(sem,static_cast<unsigned long>(rel_time.count()))!=0)
+ {
+ BOOST_INTERLOCKED_DECREMENT(&active_count);
+ return false;
+ }
+ clear_waiting_and_try_lock(old_count);
+ lock_acquired=!(old_count&lock_flag_value);
+ }
+ while(!lock_acquired);
+ }
+ return true;
+ }
+
             void unlock()
             {
                 long const offset=lock_flag_value;

Modified: branches/release/boost/thread/win32/condition_variable.hpp
==============================================================================
--- branches/release/boost/thread/win32/condition_variable.hpp (original)
+++ branches/release/boost/thread/win32/condition_variable.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -4,18 +4,24 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2007-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/win32/thread_primitives.hpp>
 #include <limits.h>
 #include <boost/assert.hpp>
 #include <algorithm>
-#include <boost/thread/thread.hpp>
+#include <boost/thread/cv_status.hpp>
+#include <boost/thread/win32/thread_data.hpp>
 #include <boost/thread/thread_time.hpp>
 #include <boost/thread/win32/interlocked_read.hpp>
 #include <boost/thread/xtime.hpp>
 #include <vector>
 #include <boost/intrusive_ptr.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
 
 #include <boost/config/abi_prefix.hpp>
 
@@ -36,10 +42,8 @@
             bool notified;
             long references;
 
- basic_cv_list_entry(basic_cv_list_entry&);
- void operator=(basic_cv_list_entry&);
-
         public:
+ BOOST_THREAD_NO_COPYABLE(basic_cv_list_entry)
             explicit basic_cv_list_entry(detail::win32::handle_manager const& wake_sem_):
                 semaphore(detail::win32::create_anonymous_semaphore(0,LONG_MAX)),
                 wake_sem(wake_sem_.duplicate()),
@@ -129,6 +133,7 @@
             template<typename lock_type>
             struct relocker
             {
+ BOOST_THREAD_NO_COPYABLE(relocker)
                 lock_type& lock;
                 bool unlocked;
 
@@ -148,9 +153,6 @@
                     }
 
                 }
- private:
- relocker(relocker&);
- void operator=(relocker&);
             };
 
 
@@ -182,6 +184,7 @@
             {
                 entry_ptr const entry;
 
+ BOOST_THREAD_NO_COPYABLE(entry_manager)
                 entry_manager(entry_ptr const& entry_):
                     entry(entry_)
                 {}
@@ -195,10 +198,6 @@
                 {
                     return entry.get();
                 }
-
- private:
- void operator=(entry_manager&);
- entry_manager(entry_manager&);
             };
 
 
@@ -247,7 +246,7 @@
             ~basic_condition_variable()
             {}
 
- void notify_one()
+ void notify_one() BOOST_NOEXCEPT
             {
                 if(detail::interlocked_read_acquire(&total_count))
                 {
@@ -268,7 +267,7 @@
                 }
             }
 
- void notify_all()
+ void notify_all() BOOST_NOEXCEPT
             {
                 if(detail::interlocked_read_acquire(&total_count))
                 {
@@ -295,10 +294,8 @@
     class condition_variable:
         private detail::basic_condition_variable
     {
- private:
- condition_variable(condition_variable&);
- void operator=(condition_variable&);
     public:
+ BOOST_THREAD_NO_COPYABLE(condition_variable)
         condition_variable()
         {}
 
@@ -347,15 +344,65 @@
         {
             return do_wait(m,wait_duration.total_milliseconds(),pred);
         }
+
+#ifdef BOOST_THREAD_USES_CHRONO
+
+ template <class Clock, class Duration>
+ cv_status
+ wait_until(
+ unique_lock<mutex>& lock,
+ const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ do_wait(lock, ceil<milliseconds>(t-Clock::now()).count());
+ return Clock::now() < t ? cv_status::no_timeout :
+ cv_status::timeout;
+ }
+
+ template <class Rep, class Period>
+ cv_status
+ wait_for(
+ unique_lock<mutex>& lock,
+ const chrono::duration<Rep, Period>& d)
+ {
+ using namespace chrono;
+ steady_clock::time_point c_now = steady_clock::now();
+ do_wait(lock, ceil<milliseconds>(d).count());
+ return steady_clock::now() - c_now < d ? cv_status::no_timeout :
+ cv_status::timeout;
+ }
+
+ template <class Clock, class Duration, class Predicate>
+ bool
+ wait_until(
+ unique_lock<mutex>& lock,
+ const chrono::time_point<Clock, Duration>& t,
+ Predicate pred)
+ {
+ while (!pred())
+ {
+ if (wait_until(lock, t) == cv_status::timeout)
+ return pred();
+ }
+ return true;
+ }
+ template <class Rep, class Period, class Predicate>
+ bool
+ wait_for(
+ unique_lock<mutex>& lock,
+ const chrono::duration<Rep, Period>& d,
+ Predicate pred)
+ {
+ return wait_until(lock, chrono::steady_clock::now() + d, pred);
+ }
+#endif
     };
 
     class condition_variable_any:
         private detail::basic_condition_variable
     {
- private:
- condition_variable_any(condition_variable_any&);
- void operator=(condition_variable_any&);
     public:
+ BOOST_THREAD_NO_COPYABLE(condition_variable_any)
         condition_variable_any()
         {}
 
@@ -409,6 +456,58 @@
         {
             return do_wait(m,wait_duration.total_milliseconds(),pred);
         }
+#ifdef BOOST_THREAD_USES_CHRONO
+
+ template <class lock_type, class Clock, class Duration>
+ cv_status
+ wait_until(
+ lock_type& lock,
+ const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ do_wait(lock, ceil<milliseconds>(t-Clock::now()).count());
+ return Clock::now() < t ? cv_status::no_timeout :
+ cv_status::timeout;
+ }
+
+ template <class lock_type, class Rep, class Period>
+ cv_status
+ wait_for(
+ lock_type& lock,
+ const chrono::duration<Rep, Period>& d)
+ {
+ using namespace chrono;
+ steady_clock::time_point c_now = steady_clock::now();
+ do_wait(lock, ceil<milliseconds>(d).count());
+ return steady_clock::now() - c_now < d ? cv_status::no_timeout :
+ cv_status::timeout;
+ }
+
+ template <class lock_type, class Clock, class Duration, class Predicate>
+ bool
+ wait_until(
+ lock_type& lock,
+ const chrono::time_point<Clock, Duration>& t,
+ Predicate pred)
+ {
+ while (!pred())
+ {
+ if (wait_until(lock, t) == cv_status::timeout)
+ return pred();
+ }
+ return true;
+ }
+
+ template <class lock_type, class Rep, class Period, class Predicate>
+ bool
+ wait_for(
+ lock_type& lock,
+ const chrono::duration<Rep, Period>& d,
+ Predicate pred)
+ {
+ return wait_until(lock, chrono::steady_clock::now() + d, pred);
+ }
+#endif
     };
 
 }

Modified: branches/release/boost/thread/win32/mutex.hpp
==============================================================================
--- branches/release/boost/thread/win32/mutex.hpp (original)
+++ branches/release/boost/thread/win32/mutex.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,12 +1,12 @@
 #ifndef BOOST_THREAD_WIN32_MUTEX_HPP
 #define BOOST_THREAD_WIN32_MUTEX_HPP
 // (C) Copyright 2005-7 Anthony Williams
+// (C) Copyright 2011-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)
 
 #include <boost/thread/win32/basic_timed_mutex.hpp>
-#include <boost/utility.hpp>
 #include <boost/thread/exceptions.hpp>
 #include <boost/thread/locks.hpp>
 
@@ -22,10 +22,8 @@
     class mutex:
         public ::boost::detail::underlying_mutex
     {
- private:
- mutex(mutex const&);
- mutex& operator=(mutex const&);
     public:
+ BOOST_THREAD_NO_COPYABLE(mutex)
         mutex()
         {
             initialize();
@@ -44,10 +42,8 @@
     class timed_mutex:
         public ::boost::detail::basic_timed_mutex
     {
- private:
- timed_mutex(timed_mutex const&);
- timed_mutex& operator=(timed_mutex const&);
     public:
+ BOOST_THREAD_NO_COPYABLE(timed_mutex)
         timed_mutex()
         {
             initialize();

Modified: branches/release/boost/thread/win32/once.hpp
==============================================================================
--- branches/release/boost/thread/win32/once.hpp (original)
+++ branches/release/boost/thread/win32/once.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -3,8 +3,9 @@
 
 // once.hpp
 //
-// (C) Copyright 2005-7 Anthony Williams
+// (C) Copyright 2005-7 Anthony Williams
 // (C) Copyright 2005 John Maddock
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -30,6 +31,25 @@
 
 namespace boost
 {
+#ifdef BOOST_THREAD_PROVIDES_ONCE_CXX11
+
+ struct once_flag
+ {
+ BOOST_THREAD_NO_COPYABLE(once_flag)
+ BOOST_CONSTEXPR once_flag() BOOST_NOEXCEPT
+ : status(0), count(0)
+ {}
+ private:
+ long status;
+ long count;
+ template<typename Function>
+ friend
+ void call_once(once_flag& flag,Function f);
+ };
+
+#define BOOST_ONCE_INIT once_flag()
+#else // BOOST_THREAD_PROVIDES_ONCE_CXX11
+
     struct once_flag
     {
         long status;
@@ -37,6 +57,7 @@
     };
 
 #define BOOST_ONCE_INIT {0,0}
+#endif // BOOST_THREAD_PROVIDES_ONCE_CXX11
 
     namespace detail
     {
@@ -71,29 +92,29 @@
 #else
             static const once_char_type fixed_mutex_name[]="Local\\{C15730E2-145C-4c5e-B005-3BC753F42475}-once-flag";
 #endif
- BOOST_STATIC_ASSERT(sizeof(fixed_mutex_name) ==
+ BOOST_STATIC_ASSERT(sizeof(fixed_mutex_name) ==
                                 (sizeof(once_char_type)*(once_mutex_name_fixed_length+1)));
-
+
             std::memcpy(mutex_name,fixed_mutex_name,sizeof(fixed_mutex_name));
- detail::int_to_string(reinterpret_cast<std::ptrdiff_t>(flag_address),
+ detail::int_to_string(reinterpret_cast<std::ptrdiff_t>(flag_address),
                                   mutex_name + once_mutex_name_fixed_length);
- detail::int_to_string(win32::GetCurrentProcessId(),
+ detail::int_to_string(win32::GetCurrentProcessId(),
                                   mutex_name + once_mutex_name_fixed_length + sizeof(void*)*2);
         }
-
+
         inline void* open_once_event(once_char_type* mutex_name,void* flag_address)
         {
             if(!*mutex_name)
             {
                 name_once_mutex(mutex_name,flag_address);
             }
-
-#ifdef BOOST_NO_ANSI_APIS
+
+#ifdef BOOST_NO_ANSI_APIS
             return ::boost::detail::win32::OpenEventW(
 #else
             return ::boost::detail::win32::OpenEventA(
 #endif
- ::boost::detail::win32::synchronize |
+ ::boost::detail::win32::synchronize |
                 ::boost::detail::win32::event_modify_state,
                 false,
                 mutex_name);
@@ -105,7 +126,7 @@
             {
                 name_once_mutex(mutex_name,flag_address);
             }
-#ifdef BOOST_NO_ANSI_APIS
+#ifdef BOOST_NO_ANSI_APIS
             return ::boost::detail::win32::CreateEventW(
 #else
             return ::boost::detail::win32::CreateEventA(
@@ -115,7 +136,7 @@
                 mutex_name);
         }
     }
-
+
 
     template<typename Function>
     void call_once(once_flag& flag,Function f)
@@ -153,7 +174,7 @@
                         counted=true;
                     }
                     BOOST_INTERLOCKED_EXCHANGE(&flag.status,function_complete_flag_value);
- if(!event_handle &&
+ if(!event_handle &&
                        (::boost::detail::interlocked_read_acquire(&flag.count)>1))
                     {
                         event_handle=detail::create_once_event(mutex_name,&flag);

Modified: branches/release/boost/thread/win32/recursive_mutex.hpp
==============================================================================
--- branches/release/boost/thread/win32/recursive_mutex.hpp (original)
+++ branches/release/boost/thread/win32/recursive_mutex.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -10,7 +10,6 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 
-#include <boost/utility.hpp>
 #include <boost/thread/win32/basic_recursive_mutex.hpp>
 #include <boost/thread/exceptions.hpp>
 #include <boost/thread/locks.hpp>
@@ -22,10 +21,8 @@
     class recursive_mutex:
         public ::boost::detail::basic_recursive_mutex
     {
- private:
- recursive_mutex(recursive_mutex const&);
- recursive_mutex& operator=(recursive_mutex const&);
     public:
+ BOOST_THREAD_NO_COPYABLE(recursive_mutex)
         recursive_mutex()
         {
             ::boost::detail::basic_recursive_mutex::initialize();
@@ -44,10 +41,8 @@
     class recursive_timed_mutex:
         public ::boost::detail::basic_recursive_timed_mutex
     {
- private:
- recursive_timed_mutex(recursive_timed_mutex const&);
- recursive_timed_mutex& operator=(recursive_timed_mutex const&);
     public:
+ BOOST_THREAD_NO_COPYABLE(recursive_timed_mutex)
         recursive_timed_mutex()
         {
             ::boost::detail::basic_recursive_timed_mutex::initialize();

Modified: branches/release/boost/thread/win32/shared_mutex.hpp
==============================================================================
--- branches/release/boost/thread/win32/shared_mutex.hpp (original)
+++ branches/release/boost/thread/win32/shared_mutex.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -2,6 +2,7 @@
 #define BOOST_THREAD_WIN32_SHARED_MUTEX_HPP
 
 // (C) Copyright 2006-8 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -12,8 +13,12 @@
 #include <boost/thread/win32/thread_primitives.hpp>
 #include <boost/static_assert.hpp>
 #include <limits.h>
-#include <boost/utility.hpp>
 #include <boost/thread/thread_time.hpp>
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#include <boost/chrono/ceil.hpp>
+#endif
+#include <boost/thread/detail/delete.hpp>
 
 #include <boost/config/abi_prefix.hpp>
 
@@ -22,9 +27,6 @@
     class shared_mutex
     {
     private:
- shared_mutex(shared_mutex const&);
- shared_mutex& operator=(shared_mutex const&);
- private:
         struct state_data
         {
             unsigned shared_count:11,
@@ -76,6 +78,7 @@
 
 
     public:
+ BOOST_THREAD_NO_COPYABLE(shared_mutex)
         shared_mutex()
         {
             semaphores[unlock_sem]=detail::win32::create_anonymous_semaphore(0,LONG_MAX);
@@ -218,6 +221,113 @@
             }
         }
 
+ template <class Rep, class Period>
+ bool try_lock_shared_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_shared_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_shared_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ return try_lock_shared_until(s_now + ceil<system_clock::duration>(t - c_now));
+ }
+ template <class Duration>
+ bool try_lock_shared_until(const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<chrono::system_clock, chrono::system_clock::duration> sys_tmpt;
+ return try_lock_shared_until(sys_tmpt(chrono::ceil<chrono::system_clock::duration>(t.time_since_epoch())));
+ }
+ bool try_lock_shared_until(const chrono::time_point<chrono::system_clock, chrono::system_clock::duration>& tp)
+ {
+ for(;;)
+ {
+ state_data old_state=state;
+ for(;;)
+ {
+ state_data new_state=old_state;
+ if(new_state.exclusive || new_state.exclusive_waiting_blocked)
+ {
+ ++new_state.shared_waiting;
+ if(!new_state.shared_waiting)
+ {
+ boost::throw_exception(boost::lock_error());
+ }
+ }
+ else
+ {
+ ++new_state.shared_count;
+ if(!new_state.shared_count)
+ {
+ boost::throw_exception(boost::lock_error());
+ }
+ }
+
+ state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state);
+ if(current_state==old_state)
+ {
+ break;
+ }
+ old_state=current_state;
+ }
+
+ if(!(old_state.exclusive| old_state.exclusive_waiting_blocked))
+ {
+ return true;
+ }
+
+ chrono::system_clock::time_point n = chrono::system_clock::now();
+ unsigned long res;
+ if (tp>n) {
+ chrono::milliseconds rel_time= chrono::ceil<chrono::milliseconds>(tp-n);
+ res=detail::win32::WaitForSingleObject(semaphores[unlock_sem],
+ static_cast<unsigned long>(rel_time.count()));
+ } else {
+ res=detail::win32::timeout;
+ }
+ if(res==detail::win32::timeout)
+ {
+ for(;;)
+ {
+ state_data new_state=old_state;
+ if(new_state.exclusive || new_state.exclusive_waiting_blocked)
+ {
+ if(new_state.shared_waiting)
+ {
+ --new_state.shared_waiting;
+ }
+ }
+ else
+ {
+ ++new_state.shared_count;
+ if(!new_state.shared_count)
+ {
+ return false;
+ }
+ }
+
+ state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state);
+ if(current_state==old_state)
+ {
+ break;
+ }
+ old_state=current_state;
+ }
+
+ if(!(old_state.exclusive| old_state.exclusive_waiting_blocked))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ BOOST_ASSERT(res==0);
+ }
+ }
+
         void unlock_shared()
         {
             state_data old_state=state;
@@ -380,6 +490,115 @@
             }
         }
 
+
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time)
+ {
+ return try_lock_until(chrono::steady_clock::now() + rel_time);
+ }
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& t)
+ {
+ using namespace chrono;
+ system_clock::time_point s_now = system_clock::now();
+ typename Clock::time_point c_now = Clock::now();
+ return try_lock_until(s_now + ceil<system_clock::duration>(t - c_now));
+ }
+ template <class Duration>
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, Duration>& t)
+ {
+ using namespace chrono;
+ typedef time_point<chrono::system_clock, chrono::system_clock::duration> sys_tmpt;
+ return try_lock_until(sys_tmpt(chrono::ceil<chrono::system_clock::duration>(t.time_since_epoch())));
+ }
+ bool try_lock_until(const chrono::time_point<chrono::system_clock, chrono::system_clock::duration>& tp)
+ {
+ for(;;)
+ {
+ state_data old_state=state;
+
+ for(;;)
+ {
+ state_data new_state=old_state;
+ if(new_state.shared_count || new_state.exclusive)
+ {
+ ++new_state.exclusive_waiting;
+ if(!new_state.exclusive_waiting)
+ {
+ boost::throw_exception(boost::lock_error());
+ }
+
+ new_state.exclusive_waiting_blocked=true;
+ }
+ else
+ {
+ new_state.exclusive=true;
+ }
+
+ state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state);
+ if(current_state==old_state)
+ {
+ break;
+ }
+ old_state=current_state;
+ }
+
+ if(!old_state.shared_count && !old_state.exclusive)
+ {
+ return true;
+ }
+ #ifndef UNDER_CE
+ const bool wait_all = true;
+ #else
+ const bool wait_all = false;
+ #endif
+
+ chrono::system_clock::time_point n = chrono::system_clock::now();
+ unsigned long wait_res;
+ if (tp>n) {
+ chrono::milliseconds rel_time= chrono::ceil<chrono::milliseconds>(tp-chrono::system_clock::now());
+ wait_res=detail::win32::WaitForMultipleObjects(2,semaphores,wait_all,
+ static_cast<unsigned long>(rel_time.count()));
+ } else {
+ wait_res=detail::win32::timeout;
+ }
+ if(wait_res==detail::win32::timeout)
+ {
+ for(;;)
+ {
+ state_data new_state=old_state;
+ if(new_state.shared_count || new_state.exclusive)
+ {
+ if(new_state.exclusive_waiting)
+ {
+ if(!--new_state.exclusive_waiting)
+ {
+ new_state.exclusive_waiting_blocked=false;
+ }
+ }
+ }
+ else
+ {
+ new_state.exclusive=true;
+ }
+
+ state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state);
+ if(current_state==old_state)
+ {
+ break;
+ }
+ old_state=current_state;
+ }
+ if(!old_state.shared_count && !old_state.exclusive)
+ {
+ return true;
+ }
+ return false;
+ }
+ BOOST_ASSERT(wait_res<2);
+ }
+ }
+
         void unlock()
         {
             state_data old_state=state;
@@ -502,6 +721,8 @@
                     if(last_reader)
                     {
                         release_waiters(old_state);
+ } else {
+ release_waiters(old_state);
                     }
                     break;
                 }
@@ -561,6 +782,27 @@
             }
             release_waiters(old_state);
         }
+// bool try_unlock_upgrade_and_lock()
+// {
+// return false;
+// }
+//#ifdef BOOST_THREAD_USES_CHRONO
+// template <class Rep, class Period>
+// bool
+// try_unlock_upgrade_and_lock_for(
+// const chrono::duration<Rep, Period>& rel_time)
+// {
+// return try_unlock_upgrade_and_lock_until(
+// chrono::steady_clock::now() + rel_time);
+// }
+// template <class Clock, class Duration>
+// bool
+// try_unlock_upgrade_and_lock_until(
+// const chrono::time_point<Clock, Duration>& abs_time)
+// {
+// return false;
+// }
+//#endif
 
         void unlock_and_lock_shared()
         {
@@ -586,7 +828,6 @@
             }
             release_waiters(old_state);
         }
-
         void unlock_upgrade_and_lock_shared()
         {
             state_data old_state=state;
@@ -612,6 +853,8 @@
         }
 
     };
+ typedef shared_mutex upgrade_mutex;
+
 }
 
 #include <boost/config/abi_suffix.hpp>

Modified: branches/release/boost/thread/win32/thread_data.hpp
==============================================================================
--- branches/release/boost/thread/win32/thread_data.hpp (original)
+++ branches/release/boost/thread/win32/thread_data.hpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -4,17 +4,58 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 // (C) Copyright 2008 Anthony Williams
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
 
 #include <boost/thread/detail/config.hpp>
 #include <boost/intrusive_ptr.hpp>
 #include <boost/thread/thread_time.hpp>
 #include <boost/thread/win32/thread_primitives.hpp>
 #include <boost/thread/win32/thread_heap_alloc.hpp>
-
+#ifdef BOOST_THREAD_USES_CHRONO
+#include <boost/chrono/system_clocks.hpp>
+#endif
 #include <boost/config/abi_prefix.hpp>
 
 namespace boost
 {
+ class thread_attributes {
+ public:
+ thread_attributes() BOOST_NOEXCEPT {
+ val_.stack_size = 0;
+ //val_.lpThreadAttributes=0;
+ }
+ ~thread_attributes() {
+ }
+ // stack size
+ void set_stack_size(std::size_t size) BOOST_NOEXCEPT {
+ val_.stack_size = size;
+ }
+
+ std::size_t get_stack_size() const BOOST_NOEXCEPT {
+ return val_.stack_size;
+ }
+
+ //void set_security(LPSECURITY_ATTRIBUTES lpThreadAttributes)
+ //{
+ // val_.lpThreadAttributes=lpThreadAttributes;
+ //}
+ //LPSECURITY_ATTRIBUTES get_security()
+ //{
+ // return val_.lpThreadAttributes;
+ //}
+
+ struct win_attrs {
+ std::size_t stack_size;
+ //LPSECURITY_ATTRIBUTES lpThreadAttributes;
+ };
+ typedef win_attrs native_handle_type;
+ native_handle_type* native_handle() {return &val_;}
+ const native_handle_type* native_handle() const {return &val_;}
+
+ private:
+ win_attrs val_;
+ };
+
     namespace detail
     {
         struct thread_exit_callback_node;
@@ -153,7 +194,7 @@
 
     namespace this_thread
     {
- void BOOST_THREAD_DECL yield();
+ void BOOST_THREAD_DECL yield() BOOST_NOEXCEPT;
 
         bool BOOST_THREAD_DECL interruptible_wait(detail::win32::handle handle_to_wait_for,detail::timeout target_time);
         inline void interruptible_wait(uintmax_t milliseconds)
@@ -174,6 +215,12 @@
         {
             interruptible_wait(abs_time);
         }
+#ifdef BOOST_THREAD_USES_CHRONO
+ inline void BOOST_SYMBOL_VISIBLE sleep_for(const chrono::nanoseconds& ns)
+ {
+ interruptible_wait(chrono::duration_cast<chrono::milliseconds>(ns).count());
+ }
+#endif
     }
 
 }

Modified: branches/release/libs/thread/build/Jamfile.v2
==============================================================================
--- branches/release/libs/thread/build/Jamfile.v2 (original)
+++ branches/release/libs/thread/build/Jamfile.v2 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,6 +1,7 @@
 # $Id$
 # Copyright 2006-2007 Roland Schwarz.
 # Copyright 2007 Anthony Williams
+# Copyright 2011-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)
@@ -44,7 +45,57 @@
       -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
       <tag>@$(__name__).tag
       <toolset>gcc:<cxxflags>-Wno-long-long
- : default-build <threading>multi
+ <define>BOOST_SYSTEM_NO_DEPRECATED
+ <library>/boost/system//boost_system
+ #-pedantic -ansi -std=gnu++0x -Wextra -fpermissive
+ <warnings>all
+ <toolset>gcc:<cxxflags>-Wextra
+ <toolset>gcc:<cxxflags>-pedantic
+ <toolset>gcc:<cxxflags>-Wno-long-long
+ #<toolset>gcc:<cxxflags>-ansi
+ #<toolset>gcc:<cxxflags>-fpermissive
+
+ <toolset>darwin:<cxxflags>-Wextra
+ <toolset>darwin:<cxxflags>-pedantic
+ <toolset>darwin:<cxxflags>-ansi
+ <toolset>darwin:<cxxflags>-fpermissive
+ <toolset>darwin:<cxxflags>-Wno-long-long
+
+ #<toolset>pathscale:<cxxflags>-Wextra
+ <toolset>pathscale:<cxxflags>-Wno-long-long
+ <toolset>pathscale:<cxxflags>-pedantic
+
+ <toolset>clang:<cxxflags>-Wextra
+ <toolset>clang:<cxxflags>-pedantic
+ <toolset>clang:<cxxflags>-ansi
+ #<toolset>clang:<cxxflags>-fpermissive
+ <toolset>clang:<cxxflags>-Wno-long-long
+
+ <toolset>gcc-mingw-4.4.0:<cxxflags>-fdiagnostics-show-option
+ <toolset>gcc-mingw-4.5.0:<cxxflags>-fdiagnostics-show-option
+ <toolset>gcc-mingw-4.6.0:<cxxflags>-fdiagnostics-show-option
+ <toolset>gcc-mingw-4.6.3:<cxxflags>-fdiagnostics-show-option
+ <toolset>gcc-mingw-4.7.0:<cxxflags>-fdiagnostics-show-option
+ <toolset>gcc-mingw-4.8.0:<cxxflags>-fdiagnostics-show-option
+
+ <toolset>darwin-4.6.2:<cxxflags>-Wno-delete-non-virtual-dtor
+ <toolset>darwin-4.7.0:<cxxflags>-Wno-delete-non-virtual-dtor
+
+ #<toolset>clang-2.8:<cxxflags>-Wno-delete-non-virtual-dtor
+ #<toolset>clang-2.8:<cxxflags>-Wno-unused-function
+ #<toolset>clang-2.9:<cxxflags>-Wno-delete-non-virtual-dtor
+ #<toolset>clang-2.9:<cxxflags>-Wno-unused-function
+ <toolset>clang-3.0:<cxxflags>-Wno-delete-non-virtual-dtor
+ #<toolset>clang-3.0:<cxxflags>-Wno-unused-function
+ #<toolset>clang-3.0:<cxxflags>-Wno-unused-variable
+
+
+ # : default-build <threading>multi
+ : usage-requirements # pass these requirement to dependents (i.e. users)
+ <link>static:<define>BOOST_THREAD_BUILD_LIB=1
+ <link>shared:<define>BOOST_THREAD_BUILD_DLL=1
+ <define>BOOST_SYSTEM_NO_DEPRECATED
+ <library>/boost/system//boost_system
     ;
 
 local rule default_threadapi ( )
@@ -60,19 +111,19 @@
 rule tag ( name : type ? : property-set )
 {
     local result = $(name) ;
-
+
     if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB
     {
         local api = [ $(property-set).get <threadapi> ] ;
-
+
         # non native api gets additional tag
         if $(api) != [ default_threadapi ] {
             result = $(result)_$(api) ;
         }
     }
-
+
     # forward to the boost tagging rule
- return [ indirect.call $(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
+ return [ indirect.call $(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
                 $(result) : $(type) : $(property-set) ] ;
 }
 
@@ -130,7 +181,7 @@
                 .notified = true ;
             }
         }
- else
+ else
         {
             result += <include>$(include_path) ;
             result += <library>$(lib_path) ;
@@ -152,6 +203,12 @@
             # in that case?
         }
     }
+
+ if ! <toolset>vacpp in $(properties) || <toolset-vacpp:version>11.1 in $(properties)
+ {
+ result += <library>/boost/chrono//boost_chrono ;
+ }
+
     return $(result) ;
 }
 
@@ -162,7 +219,7 @@
     if <threadapi>pthread in $(properties)
     {
         result += <define>BOOST_THREAD_POSIX ;
- if <target-os>windows in $(properties)
+ if <target-os>windows in $(properties)
         {
             local paths = [ win32_pthread_paths $(properties) ] ;
             if $(paths)
@@ -175,6 +232,11 @@
             }
         }
     }
+ if ! <toolset>vacpp in $(properties) || <toolset-vacpp:version>11.1 in $(properties)
+ {
+ result += <library>/boost/chrono//boost_chrono ;
+ }
+
     return $(result) ;
 }
 
@@ -198,7 +260,7 @@
 explicit thread_sources ;
 
 lib boost_thread
- : thread_sources
+ : thread_sources future.cpp
     : <conditional>@requirements
     :
     : <link>shared:<define>BOOST_THREAD_USE_DLL=1

Modified: branches/release/libs/thread/doc/Jamfile.v2
==============================================================================
--- branches/release/libs/thread/doc/Jamfile.v2 (original)
+++ branches/release/libs/thread/doc/Jamfile.v2 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,4 +1,5 @@
-# (C) Copyright 2008 Anthony Williams
+# (C) Copyright 2008-11 Anthony Williams
+# (C) Copyright 2011-12 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)
@@ -15,13 +16,13 @@
         # Use graphics not text for navigation:
         <xsl:param>navig.graphics=1
         # How far down we chunk nested sections, basically all of them:
- <xsl:param>chunk.section.depth=3
+ <xsl:param>chunk.section.depth=2
         # Don't put the first section on the same page as the TOC:
         <xsl:param>chunk.first.sections=1
         # How far down sections get TOC's
- <xsl:param>toc.section.depth=10
+ <xsl:param>toc.section.depth=4
         # Max depth in each TOC:
- <xsl:param>toc.max.depth=3
+ <xsl:param>toc.max.depth=2
         # How far down we go with TOC's
         <xsl:param>generate.section.toc.level=10
         # Path for links to Boost:

Modified: branches/release/libs/thread/doc/changes.qbk
==============================================================================
--- branches/release/libs/thread/doc/changes.qbk (original)
+++ branches/release/libs/thread/doc/changes.qbk 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,13 +1,72 @@
 [/
- (C) Copyright 2007-8 Anthony Williams.
+ (C) Copyright 2007-11 Anthony Williams.
+ (C) Copyright 2011-12 Vicente J. Botet Escriba.
   Distributed under the Boost Software License, Version 1.0.
   (See accompanying file LICENSE_1_0.txt or copy at
   http://www.boost.org/LICENSE_1_0.txt).
 ]
 
-[section:changes Changes since]
+[section:changes History]
 
-[heading Changes since boost 1.41]
+[heading Version 3.0.0 - boost 1.50]
+
+New Features:
+
+* [@http://svn.boost.org/trac/boost/ticket/1850 #1850] Request for unlock_guard to compliment lock_guard.
+* [@http://svn.boost.org/trac/boost/ticket/2637 #2637] Request for shared_mutex duration timed_lock and timed_lock_shared.
+* [@http://svn.boost.org/trac/boost/ticket/2741 #2741] Proposal to manage portable and non portable thread attributes.
+* [@http://svn.boost.org/trac/boost/ticket/3567 #3567] Request for shared_lock_guard.
+* [@http://svn.boost.org/trac/boost/ticket/6194 #6194] Adapt to Boost.Move.
+* [@http://svn.boost.org/trac/boost/ticket/6195 #6195] c++11 compliance: Provide the standard time related interface using Boost.Chrono.
+* [@http://svn.boost.org/trac/boost/ticket/6217 #6217] Enhance Boost.Thread shared mutex interface following Howard Hinnant proposal.
+* [@http://svn.boost.org/trac/boost/ticket/6224 #6224] c++11 compliance: Add the use of standard noexcept on compilers supporting them.
+* [@http://svn.boost.org/trac/boost/ticket/6226 #6226] c++11 compliance: Add explicit bool conversion from locks.
+* [@http://svn.boost.org/trac/boost/ticket/6228 #6228] Add promise constructor with allocator following the standard c++11.
+* [@http://svn.boost.org/trac/boost/ticket/6230 #6230] c++11 compliance: Follows the exception reporting mechanism as defined in the c++11.
+* [@http://svn.boost.org/trac/boost/ticket/6266 #6266] Breaking change: thread destructor should call terminate if joinable.
+* [@http://svn.boost.org/trac/boost/ticket/6269 #6269] Breaking change: thread move assignment should call terminate if joinable.
+* [@http://svn.boost.org/trac/boost/ticket/6272 #6272] c++11 compliance: Add thread::id hash specialization.
+* [@http://svn.boost.org/trac/boost/ticket/6273 #6273] c++11 compliance: Add cv_status enum class and use it on the conditions wait functions.
+* [@http://svn.boost.org/trac/boost/ticket/6231 #6231] Add BasicLockable requirements in the documentation to follow c++11.
+* [@http://svn.boost.org/trac/boost/ticket/6342 #6342] c++11 compliance: Adapt the one_flag to the c++11 interface.
+* [@http://svn.boost.org/trac/boost/ticket/6671 #6671] upgrade_lock: missing mutex and release functions.
+* [@http://svn.boost.org/trac/boost/ticket/6672 #6672] upgrade_lock:: missing constructors from time related types.
+* [@http://svn.boost.org/trac/boost/ticket/6675 #6675] upgrade_lock:: missing non-member swap.
+* Added missing packaged_task::result_type and packaged_task:: constructor with allocator.
+* Added packaged_task::reset()
+
+Fixed Bugs:
+
+* [@http://svn.boost.org/trac/boost/ticket/2575 #2575] Bug- Boost 1.36.0 on Itanium platform.
+* [@http://svn.boost.org/trac/boost/ticket/4345 #4345] thread::id and joining problem with cascade of threads.
+* [@http://svn.boost.org/trac/boost/ticket/4921 #4921] BOOST_THREAD_USE_DLL and BOOST_THREAD_USE_LIB are crucial and need to be documented.
+* [@http://svn.boost.org/trac/boost/ticket/5013 #5013] documentation: boost::thread: pthreas_exit causes terminate().
+* [@http://svn.boost.org/trac/boost/ticket/5173 #5173] boost::this_thread::get_id is very slow.
+* [@http://svn.boost.org/trac/boost/ticket/5351 #5351] interrupt a future get boost::unknown_exception.
+* [@http://svn.boost.org/trac/boost/ticket/5516 #5516] Upgrade lock is not acquired when previous upgrade lock releases if another read lock is present.
+* [@http://svn.boost.org/trac/boost/ticket/5990 #5990] shared_future<T>::get() has wrong return type.
+* [@http://svn.boost.org/trac/boost/ticket/6174 #6174] packaged_task doesn't correctly handle moving results.
+* [@http://svn.boost.org/trac/boost/ticket/6222 #6222] Compile error with SunStudio: unique_future move.
+* [@http://svn.boost.org/trac/boost/ticket/6673 #6673] shared_lock: move assign doesn't works with c++11.
+* [@http://svn.boost.org/trac/boost/ticket/6674 #6674] shared_mutex: try_lock_upgrade_until doesn't works.
+* Fix issue signaled on the ML with task_object(task_object const&) in presence of task_object(task_object &&)
+
+[/
+Deprecated features since boost 1.50 available only until boost 1.55:
+
+These deprecated features will be provided by default up to boost 1.52. If you don't want to include the deprecated features you could define BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0. Since 1.53 these features will not be included any more by default. Since this version, if you want to include the deprecated features yet you could define BOOST_THREAD_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0. These deprecated features will be only available until boost 1.55, that is you have 1 year and a half to move to the new features.
+
+* Time related functions don't using the Boost.Chrono library, use the chrono overloads instead.
+
+Breaking changes:
+
+There are some new features which share the same interface but with different behavior. These breaking features are provided by default when BOOST_THREAD_VERSION is 2, but the user can however choose the version 1 behavior by defining the corresponding macro. As for the deprecated features, these broken features will be only available until boost 1.55.
+
+* #6266 c++11 compliance: thread destructor should call terminate if joinable
+* #6269 c++11 compliance: thread move assignment should call terminate if joinable
+]
+
+[heading Version 2.1.1 - boost 1.49]
 
 Fixed Bugs:
 
@@ -24,10 +83,7 @@
 * [@http://svn.boost.org/trac/boost/ticket/4480 #4480] OpenVMS patches for compiler issues workarounds.
 * [@http://svn.boost.org/trac/boost/ticket/4819 #4819] boost.thread's documentation misprints.
 
-* [@http://svn.boost.org/trac/boost/ticket/5040 #5040] future.hpp in boost::thread does not compile with /clr.
 * [@http://svn.boost.org/trac/boost/ticket/5423 #5423] thread issues with C++0x.
-* [@http://svn.boost.org/trac/boost/ticket/5502 #5502] race condition between shared_mutex timed_lock and lock_shared.
-* [@http://svn.boost.org/trac/boost/ticket/5594 #5594] boost::shared_mutex not fully compatible with Windows CE.
 * [@http://svn.boost.org/trac/boost/ticket/5617 #5617] boost::thread::id copy ctor.
 * [@http://svn.boost.org/trac/boost/ticket/5739 #5739] set-but-not-used warnings with gcc-4.6.
 * [@http://svn.boost.org/trac/boost/ticket/5826 #5826] threads.cpp: resource leak on threads creation failure.
@@ -35,15 +91,13 @@
 * [@http://svn.boost.org/trac/boost/ticket/5859 #5859] win32 shared_mutex constructor leaks on exceptions.
 
 * [@http://svn.boost.org/trac/boost/ticket/6100 #6100] Compute hardware_concurrency() using get_nprocs() on GLIBC systems.
-* [@http://svn.boost.org/trac/boost/ticket/6141 #6141] Compilation error when boost.thread and boost.move are used together.
 * [@http://svn.boost.org/trac/boost/ticket/6168 #6168] recursive_mutex is using wrong config symbol (possible typo).
 * [@http://svn.boost.org/trac/boost/ticket/6175 #6175] Compile error with SunStudio.
 * [@http://svn.boost.org/trac/boost/ticket/6200 #6200] patch to have condition_variable and mutex error better handle EINTR.
 * [@http://svn.boost.org/trac/boost/ticket/6207 #6207] shared_lock swap compiler error on clang 3.0 c++11.
 * [@http://svn.boost.org/trac/boost/ticket/6208 #6208] try_lock_wrapper swap compiler error on clang 3.0 c++11.
 
-
-[heading Changes since boost 1.40]
+[heading Version 2.1.0 - Changes since boost 1.40]
 
 The 1.41.0 release of Boost adds futures to the thread library. There are also a few minor changes.
 
@@ -63,7 +117,7 @@
 
 * Backwards-compatibility overloads added for `timed_lock` and `timed_wait` functions to allow use of `xtime` for timeouts.
 
-[heading Changes since boost 1.34]
+[heading Version 2.0.0 - Changes since boost 1.34]
 
 Almost every line of code in __boost_thread__ has been changed since the 1.34 release of boost. However, most of the interface
 changes have been extensions, so the new code is largely backwards-compatible with the old code. The new features and breaking
@@ -126,19 +180,15 @@
 
 [section:future Future]
 
-The following features will be included in next releases. By order of priority:
+The following features will be included in next releases.
+
+# Complete the C++11 missing features, in particular
+
+ * [@http://svn.boost.org/trac/boost/ticket/4710 #4710] Missing async().
+ * [@http://svn.boost.org/trac/boost/ticket/6227 #6227] Use of variadic templates on Generic Locking Algorithms on compilers providing them.
+ * [@http://svn.boost.org/trac/boost/ticket/6270 #6270] Add thread constructor from movable callable and movable arguments following C++11.
+
 
-* [@http://svn.boost.org/trac/boost/ticket/6194 #6194] Adapt to Boost.Move.
-* [@http://svn.boost.org/trac/boost/ticket/4710 #4710] Missing async().
-* [@http://svn.boost.org/trac/boost/ticket/6195 #6195] Provide the standard time related interface using Boost.Chrono.
- * [@http://svn.boost.org/trac/boost/ticket/2637 #2637] shared mutex lock
-* Lock guards
- * [@http://svn.boost.org/trac/boost/ticket/1850 #1850] request for unlock_guard (and/or unique_unlock) to compliment lock_guard/unique_lock
- * [@http://svn.boost.org/trac/boost/ticket/3567 #3567] Request for shared_lock_guard
-* [@http://svn.boost.org/trac/boost/ticket/2741 #2741] Proposal to manage portable and non portable thread attributes.
- * #2880 Request for Thread scheduler support for boost ..
- * #3696 Boost Thread library lacks any way to set priority of threads
- * #5956 Add optional stack_size argument to thread::start_thread()
 
 [endsect]
 

Modified: branches/release/libs/thread/doc/condition_variables.qbk
==============================================================================
--- branches/release/libs/thread/doc/condition_variables.qbk (original)
+++ branches/release/libs/thread/doc/condition_variables.qbk 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,5 +1,6 @@
 [/
- (C) Copyright 2007-8 Anthony Williams.
+ (C) Copyright 2007-11 Anthony Williams.
+ (C) Copyright 2011-12 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).
@@ -9,6 +10,17 @@
 
 [heading Synopsis]
 
+ namespace boost
+ {
+ enum class cv_status;
+ {
+ no_timeout,
+ timeout
+ };
+ class condition_variable;
+ class condition_variable_any;
+ }
+
 The classes `condition_variable` and `condition_variable_any` provide a
 mechanism for one thread to wait for notification from another thread that a
 particular condition has become true. The general usage pattern is that one
@@ -84,31 +96,54 @@
             condition_variable();
             ~condition_variable();
 
- void notify_one();
- void notify_all();
+ void notify_one() noexcept;
+ void notify_all() noexcept;
 
             void wait(boost::unique_lock<boost::mutex>& lock);
 
             template<typename predicate_type>
             void wait(boost::unique_lock<boost::mutex>& lock,predicate_type predicate);
 
- bool timed_wait(boost::unique_lock<boost::mutex>& lock,boost::system_time const& abs_time);
+ template <class Clock, class Duration>
+ typename cv_status::type
+ wait_until(
+ unique_lock<mutex>& lock,
+ const chrono::time_point<Clock, Duration>& t);
+
+ template <class Clock, class Duration, class Predicate>
+ bool
+ wait_until(
+ unique_lock<mutex>& lock,
+ const chrono::time_point<Clock, Duration>& t,
+ Predicate pred);
+
+ template <class Rep, class Period>
+ typename cv_status::type
+ wait_for(
+ unique_lock<mutex>& lock,
+ const chrono::duration<Rep, Period>& d);
+
+ template <class Rep, class Period, class Predicate>
+ bool
+ wait_for(
+ unique_lock<mutex>& lock,
+ const chrono::duration<Rep, Period>& d,
+ Predicate pred);
 
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 || defined BOOST_THREAD_DONT_USE_CHRONO
+ bool timed_wait(boost::unique_lock<boost::mutex>& lock,boost::system_time const& abs_time);
             template<typename duration_type>
             bool timed_wait(boost::unique_lock<boost::mutex>& lock,duration_type const& rel_time);
-
             template<typename predicate_type>
             bool timed_wait(boost::unique_lock<boost::mutex>& lock,boost::system_time const& abs_time,predicate_type predicate);
-
             template<typename duration_type,typename predicate_type>
             bool timed_wait(boost::unique_lock<boost::mutex>& lock,duration_type const& rel_time,predicate_type predicate);
-
- // backwards compatibility
-
             bool timed_wait(boost::unique_lock<boost::mutex>& lock,boost::xtime const& abs_time);
 
             template<typename predicate_type>
             bool timed_wait(boost::unique_lock<boost::mutex>& lock,boost::xtime const& abs_time,predicate_type predicate);
+ #endif
+
         };
     }
 
@@ -292,6 +327,114 @@
 [endsect]
 
 
+[section:wait_until `template <class Clock, class Duration> cv_status wait_until(boost::unique_lock<boost::mutex>& lock, const chrono::time_point<Clock, Duration>& abs_time)`]
+
+[variablelist
+
+[[Precondition:] [`lock` is locked by the current thread, and either no other
+thread is currently waiting on `*this`, or the execution of the `mutex()` member
+function on the `lock` objects supplied in the calls to `wait` or `wait_for` or `wait_until`
+in all the threads currently waiting on `*this` would return the same value as
+`lock->mutex()` for this call to `wait`.]]
+
+[[Effects:] [Atomically call `lock.unlock()` and blocks the current thread. The
+thread will unblock when notified by a call to `this->notify_one()` or
+`this->notify_all()`, when the time as reported by `Clock::now()`
+would be equal to or later than the specified `abs_time`, or spuriously. When
+the thread is unblocked (for whatever reason), the lock is reacquired by
+invoking `lock.lock()` before the call to `wait` returns. The lock is also
+reacquired by invoking `lock.lock()` if the function exits with an exception.]]
+
+[[Returns:] [`cv_status::no_timeout` if the call is returning because the time specified by
+`abs_time` was reached, `cv_status::timeout` otherwise.]]
+
+[[Postcondition:] [`lock` is locked by the current thread.]]
+
+[[Throws:] [__thread_resource_error__ if an error
+occurs. __thread_interrupted__ if the wait was interrupted by a call to
+__interrupt__ on the __thread__ object associated with the current thread of execution.]]
+
+]
+
+[endsect]
+
+[section:wait_for `template <class Rep, class Period> cv_status wait_for(boost::unique_lock<boost::mutex>& lock, const chrono::duration<Rep, Period>& rel_time)`]
+
+
+[variablelist
+
+[[Precondition:] [`lock` is locked by the current thread, and either no other
+thread is currently waiting on `*this`, or the execution of the `mutex()` member
+function on the `lock` objects supplied in the calls to `wait` or `wait_until` or `wait_for`
+in all the threads currently waiting on `*this` would return the same value as
+`lock->mutex()` for this call to `wait`.]]
+
+[[Effects:] [Atomically call `lock.unlock()` and blocks the current thread. The
+thread will unblock when notified by a call to `this->notify_one()` or
+`this->notify_all()`, after the period of time indicated by the `rel_time`
+argument has elapsed, or spuriously. When the thread is unblocked (for whatever
+reason), the lock is reacquired by invoking `lock.lock()` before the call to
+`wait` returns. The lock is also reacquired by invoking `lock.lock()` if the
+function exits with an exception.]]
+
+[[Returns:] [`cv_status::no_timeout ` if the call is returning because the time period specified
+by `rel_time` has elapsed, `cv_status::timeout ` otherwise.]]
+
+[[Postcondition:] [`lock` is locked by the current thread.]]
+
+[[Throws:] [__thread_resource_error__ if an error
+occurs. __thread_interrupted__ if the wait was interrupted by a call to
+__interrupt__ on the __thread__ object associated with the current thread of execution.]]
+
+]
+
+[note The duration overload of timed_wait is difficult to use correctly. The overload taking a predicate should be preferred in most cases.]
+
+[endsect]
+
+[section:wait_until_predicate `template <class Clock, class Duration, class Predicate> bool wait_until(boost::unique_lock<boost::mutex>& lock, const chrono::time_point<Clock, Duration>& abs_time, Predicate pred)`]
+
+
+[variablelist
+
+[[Effects:] [As-if ``
+while(!pred())
+{
+ if(!wait_until(lock,abs_time))
+ {
+ return pred();
+ }
+}
+return true;
+``]]
+
+]
+
+[endsect]
+
+[section:wait_for_predicate `template <class Rep, class Period, class Predicate> bool wait_for(boost::unique_lock<boost::mutex>& lock, const chrono::duration<Rep, Period>& rel_time, Predicate pred)`]
+
+
+[variablelist
+
+[[Effects:] [As-if ``
+while(!pred())
+{
+ if(!wait_for(lock,rel_time))
+ {
+ return pred();
+ }
+}
+return true;
+``]]
+
+]
+
+[endsect]
+
+
+
+
 [endsect]
 
 [section:condition_variable_any Class `condition_variable_any`]
@@ -315,25 +458,43 @@
             template<typename lock_type,typename predicate_type>
             void wait(lock_type& lock,predicate_type predicate);
 
+ template <class lock_type, class Clock, class Duration>
+ cv_status wait_until(
+ lock_type& lock,
+ const chrono::time_point<Clock, Duration>& t);
+
+ template <class lock_type, class Clock, class Duration, class Predicate>
+ bool wait_until(
+ lock_type& lock,
+ const chrono::time_point<Clock, Duration>& t,
+ Predicate pred);
+
+
+ template <class lock_type, class Rep, class Period>
+ cv_status wait_for(
+ lock_type& lock,
+ const chrono::duration<Rep, Period>& d);
+
+ template <class lock_type, class Rep, class Period, class Predicate>
+ bool wait_for(
+ lock_type& lock,
+ const chrono::duration<Rep, Period>& d,
+ Predicate pred);
+
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 || defined BOOST_THREAD_DONT_USE_CHRONO
             template<typename lock_type>
             bool timed_wait(lock_type& lock,boost::system_time const& abs_time);
-
             template<typename lock_type,typename duration_type>
             bool timed_wait(lock_type& lock,duration_type const& rel_time);
-
             template<typename lock_type,typename predicate_type>
             bool timed_wait(lock_type& lock,boost::system_time const& abs_time,predicate_type predicate);
-
             template<typename lock_type,typename duration_type,typename predicate_type>
             bool timed_wait(lock_type& lock,duration_type const& rel_time,predicate_type predicate);
-
- // backwards compatibility
-
             template<typename lock_type>
             bool timed_wait(lock_type>& lock,boost::xtime const& abs_time);
-
             template<typename lock_type,typename predicate_type>
             bool timed_wait(lock_type& lock,boost::xtime const& abs_time,predicate_type predicate);
+ #endif
         };
     }
 
@@ -498,6 +659,96 @@
 
 [endsect]
 
+[section:wait_until `template <class lock_type, class Clock, class Duration> cv_status wait_until(lock_type& lock, const chrono::time_point<Clock, Duration>& abs_time)`]
+
+[variablelist
+
+[[Effects:] [Atomically call `lock.unlock()` and blocks the current thread. The
+thread will unblock when notified by a call to `this->notify_one()` or
+`this->notify_all()`, when the time as reported by `Clock::now()`
+would be equal to or later than the specified `abs_time`, or spuriously. When
+the thread is unblocked (for whatever reason), the lock is reacquired by
+invoking `lock.lock()` before the call to `wait` returns. The lock is also
+reacquired by invoking `lock.lock()` if the function exits with an exception.]]
+
+[[Returns:] [`cv_status::timeout` if the call is returning because the time specified by
+`abs_time` was reached, `cv_status::no_timeout` otherwise.]]
+
+[[Postcondition:] [`lock` is locked by the current thread.]]
+
+[[Throws:] [__thread_resource_error__ if an error
+occurs. __thread_interrupted__ if the wait was interrupted by a call to
+__interrupt__ on the __thread__ object associated with the current thread of execution.]]
+
+]
+
+[endsect]
+
+[section:wait_for `template <class lock_type, class Rep, class Period> cv_status wait_for(lock_type& lock, const chrono::duration<Rep, Period>& rel_time)`]
+
+[variablelist
+
+[[Effects:] [Atomically call `lock.unlock()` and blocks the current thread. The
+thread will unblock when notified by a call to `this->notify_one()` or
+`this->notify_all()`, after the period of time indicated by the `rel_time`
+argument has elapsed, or spuriously. When the thread is unblocked (for whatever
+reason), the lock is reacquired by invoking `lock.lock()` before the call to
+`wait` returns. The lock is also reacquired by invoking `lock.lock()` if the
+function exits with an exception.]]
+
+[[Returns:] [`cv_status::timeout` if the call is returning because the time specified by
+`abs_time` was reached, `cv_status::no_timeout` otherwise.]]
+
+[[Postcondition:] [`lock` is locked by the current thread.]]
+
+[[Throws:] [__thread_resource_error__ if an error
+occurs. __thread_interrupted__ if the wait was interrupted by a call to
+__interrupt__ on the __thread__ object associated with the current thread of execution.]]
+
+]
+
+[note The duration overload of timed_wait is difficult to use correctly. The overload taking a predicate should be preferred in most cases.]
+
+[endsect]
+
+[section:wait_until_predicate `template <class lock_type, class Clock, class Duration, class Predicate> bool wait_until(lock_type& lock, const chrono::time_point<Clock, Duration>& abs_time, Predicate pred)`]
+
+[variablelist
+
+[[Effects:] [As-if ``
+while(!pred())
+{
+ if(!__cvany_wait_until(lock,abs_time))
+ {
+ return pred();
+ }
+}
+return true;
+``]]
+
+]
+
+[endsect]
+
+[section:wait_for_predicate `template <class lock_type, class Rep, class Period, class Predicate> bool wait_until(lock_type& lock, const chrono::duration<Rep, Period>& rel_time, Predicate pred)`]
+
+[variablelist
+
+[[Effects:] [As-if ``
+while(!pred())
+{
+ if(!__cvany_wait_for(lock,rel_time))
+ {
+ return pred();
+ }
+}
+return true;
+``]]
+
+]
+
+[endsect]
+
 [endsect]
 
 [section:condition Typedef `condition`]

Modified: branches/release/libs/thread/doc/future_ref.qbk
==============================================================================
--- branches/release/libs/thread/doc/future_ref.qbk (original)
+++ branches/release/libs/thread/doc/future_ref.qbk 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,5 +1,5 @@
 [/
- (C) Copyright 2008-9 Anthony Williams.
+ (C) Copyright 2008-11 Anthony Williams.
   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).
@@ -7,12 +7,155 @@
 
 [section:reference Futures Reference]
 
-[section:future_state `state` enum]
+ //#include <boost/thread/futures.hpp>
 
+ namespace boost
+ {
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
     namespace future_state
     {
- enum state {uninitialized, waiting, ready};
+ enum state {uninitialized, waiting, ready, moved};
     }
+ #endif
+
+ enum class future_errc
+ {
+ broken_promise,
+ future_already_retrieved,
+ promise_already_satisfied,
+ no_state
+ };
+
+ namespace system
+ {
+ template <>
+ struct is_error_code_enum<future_errc> : public true_type {};
+
+ error_code make_error_code(future_errc e);
+
+ error_condition make_error_condition(future_errc e);
+ }
+
+ const system::error_category& future_category();
+
+ class future_error;
+
+ template <typename R>
+ class promise;
+
+ template <typename R>
+ void swap(promise<R>& x, promise<R>& y) noexcept;
+
+ namespace container {
+ template <class R, class Alloc>
+ struct uses_allocator<promise<R>, Alloc>:: true_type;
+ }
+
+ template <typename R>
+ class future;
+
+ template <typename R>
+ class shared_future;
+
+ template <typename R>
+ class packaged_task;
+ template <class R> void swap(packaged_task<R>&, packaged_task<R>&) noexcept;
+
+ //template <class R, class Alloc>
+ //struct uses_allocator<packaged_task <R>, Alloc>; // NOT YET IMPLEMENTED
+
+ // template <class F, class... Args>
+ // future<typename result_of<typename decay<F>::type(typename decay<Args>::type...)>::type>
+ // async(F&& f, Args&&... args); // NOT YET IMPLEMENTED
+ // template <class F, class... Args>
+ // future<typename result_of<typename decay<F>::type(typename decay<Args>::type...)>::type>
+ // async(launch policy, F&& f, Args&&... args); // NOT YET IMPLEMENTED
+
+
+ template<typename Iterator>
+ void wait_for_all(Iterator begin,Iterator end); // EXTENSION
+
+ template<typename F1,typename... FS>
+ void wait_for_all(F1& f1,Fs&... fs); // EXTENSION
+
+ template<typename Iterator>
+ Iterator wait_for_any(Iterator begin,Iterator end);
+
+ template<typename F1,typename... Fs>
+ unsigned wait_for_any(F1& f1,Fs&... fs);
+
+
+[section:future_state Enumeration `state`]
+
+ namespace future_state
+ {
+ enum state {uninitialized, waiting, ready, moved};
+ }
+
+
+[endsect]
+
+
+[section:future_errc Enumeration `future_errc `]
+
+ enum class future_errc
+ {
+ broken_promise,
+ future_already_retrieved,
+ promise_already_satisfied,
+ no_state
+ }
+
+[endsect]
+[section:is_error_code_enum Specialization `is_error_code_enum<future_errc>`]
+
+ namespace system
+ {
+ template <>
+ struct is_error_code_enum<future_errc> : public true_type {};
+
+ }
+
+[endsect]
+[section:make_error_code Non-member function `make_error_code()`]
+
+ namespace system
+ {
+ error_code make_error_code(future_errc e);
+ }
+
+[endsect]
+[section:make_error_condition Non-member function `make_error_condition()`]
+
+ namespace system
+ {
+ error_condition make_error_condition(future_errc e);
+ }
+
+[endsect]
+[section:future_category Non-member function `future_category()`]
+
+ const system::error_category& future_category();
+
+[endsect]
+[section:future_error Class `future_error`]
+
+ class future_error
+ : public std::logic_error
+ {
+ public:
+ future_error(system::error_code ec);
+
+ const system::error_code& code() const no_except;
+ };
+
+[endsect]
+
+[section:future_status Enumeration `future_status`]
+
+ enum class future_status {
+ ready, timeout, deferred
+ };
 
 [endsect]
 
@@ -21,35 +164,46 @@
     template <typename R>
     class unique_future
     {
- unique_future(unique_future & rhs);// = delete;
- unique_future& operator=(unique_future& rhs);// = delete;
 
     public:
- typedef future_state::state state;
+ unique_future(unique_future & rhs);// = delete;
+ unique_future& operator=(unique_future& rhs);// = delete;
 
- unique_future();
+ unique_future() noexcept;
         ~unique_future();
 
         // move support
- unique_future(unique_future && other);
- unique_future& operator=(unique_future && other);
+ unique_future(unique_future && other) noexcept;
+ unique_future& operator=(unique_future && other) noexcept;
+ shared_future<R> share();
 
- void swap(unique_future& other);
+ void swap(unique_future& other) noexcept; // EXTENSION
 
         // retrieving the value
         R&& get();
 
         // functions to check state
- state get_state() const;
- bool is_ready() const;
- bool has_exception() const;
- bool has_value() const;
+ bool valid() const;
+ bool is_ready() const; // EXTENSION
+ bool has_exception() const; // EXTENSION
+ bool has_value() const; // EXTENSION
 
         // waiting for the result to be ready
- void wait() const;
+ void wait() const;
+ template <class Rep, class Period>
+ future_status wait_for(const chrono::duration<Rep, Period>& rel_time) const;
+ template <class Clock, class Duration>
+ future_status wait_until(const chrono::time_point<Clock, Duration>& abs_time) const;
+
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 || defined BOOST_THREAD_DONT_USE_CHRONO
         template<typename Duration>
         bool timed_wait(Duration const& rel_time) const;
- bool timed_wait_until(boost::system_time const& abs_time) const;
+ bool timed_wait_until(boost::system_time const& abs_time) const;
+ #endif
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
+ typedef future_state::state state;
+ state get_state() const;
+ #endif
     };
 
 [section:default_constructor Default Constructor]
@@ -126,7 +280,7 @@
 
 [section:swap Member function `swap()`]
 
- void swap(unique_future & other);
+ void swap(unique_future & other) no_except;
 
 [variablelist
 
@@ -247,7 +401,7 @@
 [endsect]
 
 
-[section:is_ready Member function `is_ready()`]
+[section:is_ready Member function `is_ready()` EXTENSION]
 
     bool is_ready();
 
@@ -264,7 +418,7 @@
 
 [endsect]
 
-[section:has_value Member function `has_value()`]
+[section:has_value Member function `has_value()` EXTENSION]
 
     bool has_value();
 
@@ -281,7 +435,7 @@
 
 [endsect]
 
-[section:has_exception Member function `has_exception()`]
+[section:has_exception Member function `has_exception()` EXTENSION]
 
     bool has_exception();
 
@@ -324,9 +478,9 @@
     class shared_future
     {
     public:
- typedef future_state::state state;
+ typedef future_state::state state; // EXTENSION
 
- shared_future();
+ shared_future() noexcept;
         ~shared_future();
 
         // copy support
@@ -334,10 +488,10 @@
         shared_future& operator=(shared_future const& other);
 
         // move support
- shared_future(shared_future && other);
- shared_future(unique_future<R> && other);
- shared_future& operator=(shared_future && other);
- shared_future& operator=(unique_future<R> && other);
+ shared_future(shared_future && other) noexcept;
+ shared_future(unique_future<R> && other) noexcept;
+ shared_future& operator=(shared_future && other) noexcept;
+ shared_future& operator=(unique_future<R> && other) noexcept;
 
         void swap(shared_future& other);
 
@@ -345,16 +499,26 @@
         R get();
         
         // functions to check state, and wait for ready
- state get_state() const;
- bool is_ready() const;
- bool has_exception() const;
- bool has_value() const;
+ bool valid() const noexcept;
+ bool is_ready() const noexcept; // EXTENSION
+ bool has_exception() const noexcept; // EXTENSION
+ bool has_value() const noexcept; // EXTENSION
 
         // waiting for the result to be ready
         void wait() const;
+ template <class Rep, class Period>
+ future_status wait_for(const chrono::duration<Rep, Period>& rel_time) const;
+ template <class Clock, class Duration>
+ future_status wait_until(const chrono::time_point<Clock, Duration>& abs_time) const;
+
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 || defined BOOST_THREAD_DONT_USE_CHRONO
         template<typename Duration>
         bool timed_wait(Duration const& rel_time) const;
- bool timed_wait_until(boost::system_time const& abs_time) const;
+ bool timed_wait_until(boost::system_time const& abs_time) const;
+ #endif
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
+ state get_state() const noexcept;
+ #endif
     };
 
 [section:default_constructor Default Constructor]
@@ -470,7 +634,7 @@
 
 [endsect]
 
-[section:is_ready Member function `is_ready()`]
+[section:is_ready Member function `is_ready()` EXTENSION]
 
     bool is_ready();
 
@@ -487,7 +651,7 @@
 
 [endsect]
 
-[section:has_value Member function `has_value()`]
+[section:has_value Member function `has_value()` EXTENSION]
 
     bool has_value();
 
@@ -504,7 +668,7 @@
 
 [endsect]
 
-[section:has_exception Member function `has_exception()`]
+[section:has_exception Member function `has_exception()` EXTENSION]
 
     bool has_exception();
 
@@ -546,19 +710,20 @@
     template <typename R>
     class promise
     {
- promise(promise & rhs);// = delete;
- promise & operator=(promise & rhs);// = delete;
     public:
- // template <class Allocator> explicit promise(Allocator a);
 
         promise();
+ template <class Allocator>
+ promise(allocator_arg_t, Allocator a);
+ promise & operator=(const promise & rhs);// = delete;
+ promise(const promise & rhs);// = delete;
         ~promise();
 
         // Move support
- promise(promise && rhs);
- promise & operator=(promise&& rhs);
+ promise(promise && rhs) noexcept;;
+ promise & operator=(promise&& rhs) noexcept;;
         
- void swap(promise& other);
+ void swap(promise& other) noexcept;
         // Result retrieval
         unique_future<R> get_future();
 
@@ -567,8 +732,13 @@
         void set_value(R&& r);
         void set_exception(boost::exception_ptr e);
 
+ // setting the result with deferred notification
+ // void set_value_at_thread_exit(const R& r); // NOT YET IMPLEMENTED
+ // void set_value_at_thread_exit(see below); // NOT YET IMPLEMENTED
+ // void set_exception_at_thread_exit(exception_ptr p); // NOT YET IMPLEMENTED
+
         template<typename F>
- void set_wait_callback(F f);
+ void set_wait_callback(F f); // EXTENSION
     };
 
 [section:default_constructor Default Constructor]
@@ -585,6 +755,25 @@
 
 [endsect]
 
+[section:alloc_constructor Allocator Constructor]
+
+ template <class Allocator>
+ promise(allocator_arg_t, Allocator a);
+
+[variablelist
+
+[[Effects:] [Constructs a new __promise__ with no associated result using the allocator `a`.]]
+
+[[Throws:] [Nothing.]]
+
+[[Notes:] [Available only if BOOST_THREAD_FUTURE_USES_ALLOCATORS is defined.]]
+
+]
+
+[endsect]
+
+
+
 [section:move_constructor Move Constructor]
 
     promise(promise && other);
@@ -718,50 +907,53 @@
 
 [section:packaged_task `packaged_task` class template]
 
- template<typename R>
+ template<typename R
+ // , class... ArgTypes // NOT YET IMPLEMENTED
+ >
     class packaged_task
     {
+ public:
+ typedef R result_type;
+
         packaged_task(packaged_task&);// = delete;
         packaged_task& operator=(packaged_task&);// = delete;
-
- public:
+
         // construction and destruction
- template <class F>
- explicit packaged_task(F const& f);
+ packaged_task() noexcept;
 
         explicit packaged_task(R(*f)());
         
         template <class F>
         explicit packaged_task(F&& f);
 
- // template <class F, class Allocator>
- // explicit packaged_task(F const& f, Allocator a);
- // template <class F, class Allocator>
- // explicit packaged_task(F&& f, Allocator a);
+ template <class F, class Allocator>
+ packaged_task(allocator_arg_t, Allocator a, F&& f);
 
         ~packaged_task()
         {}
 
         // move support
- packaged_task(packaged_task&& other);
- packaged_task& operator=(packaged_task&& other);
+ packaged_task(packaged_task&& other) noexcept;
+ packaged_task& operator=(packaged_task&& other) noexcept;
+
+ void swap(packaged_task& other) noexcept;
 
- void swap(packaged_task& other);
+ bool valid() const noexcept;
         // result retrieval
         unique_future<R> get_future();
 
         // execution
         void operator()();
+ // void operator()(ArgTypes... ); // NOT YET IMPLEMENTED
+ // void make_ready_at_thread_exit(ArgTypes...); // NOT YET IMPLEMENTED
 
+ void reset();
         template<typename F>
- void set_wait_callback(F f);
+ void set_wait_callback(F f); // EXTENSION
     };
 
 [section:task_constructor Task Constructor]
 
- template<typename F>
- packaged_task(F const &f);
-
     packaged_task(R(*f)());
 
     template<typename F>
@@ -772,11 +964,37 @@
 [[Preconditions:] [`f()` is a valid expression with a return type convertible to `R`. Invoking a copy of `f` shall behave the same
 as invoking `f`.]]
 
-[[Effects:] [Constructs a new __packaged_task__ with a copy of `f` stored as the associated task.]]
+[[Effects:] [Constructs a new __packaged_task__ with `boost::forward<F>(f)` stored as the associated task.]]
 
 [[Throws:] [Any exceptions thrown by the copy (or move) constructor of `f`. `std::bad_alloc` if memory for the internal data
 structures could not be allocated.]]
 
+[[Notes:] [The R(*f)()) overload to allow passing a function without needing to use `&`.]]
+
+]
+
+[endsect]
+
+[section:alloc_constructor Allocator Constructor]
+
+ template <class Allocator>
+ packaged_task(allocator_arg_t, Allocator a, R(*f)());
+ template <class F, class Allocator>
+ packaged_task(allocator_arg_t, Allocator a, F&& f);
+
+[variablelist
+
+[[Preconditions:] [`f()` is a valid expression with a return type convertible to `R`. Invoking a copy of `f` shall behave the same
+as invoking `f`.]]
+
+[[Effects:] [Constructs a new __packaged_task with `boost::forward<F>(f)` stored as the associated task using the allocator `a`.]]
+
+[[Throws:] [Any exceptions thrown by the copy (or move) constructor of `f`. `std::bad_alloc` if memory for the internal data
+structures could not be allocated.]]
+
+[[Notes:] [Available only if BOOST_THREAD_FUTURE_USES_ALLOCATORS is defined.]]
+[[Notes:] [The R(*f)()) overload to allow passing a function without needing to use `&`.]]
+
 ]
 
 [endsect]
@@ -798,6 +1016,7 @@
 
 [endsect]
 
+
 [section:move_assignment Move Assignment Operator]
 
     packaged_task& operator=(packaged_task && other);
@@ -865,7 +1084,22 @@
 
 [endsect]
 
-[section:set_wait_callback Member Function `set_wait_callback()`]
+[section:reset Member Function `reset()`]
+
+ void reset();
+
+[variablelist
+
+[[Effects:] [Reset the state of the packaged_task so that it can be called again.]]
+
+[[Throws:] [__task_moved__ if ownership of the task associated with `*this` has been moved to another instance of
+__packaged_task__.]]
+
+]
+
+[endsect]
+
+[section:set_wait_callback Member Function `set_wait_callback()` EXTENSION]
 
     template<typename F>
     void set_wait_callback(F f);

Modified: branches/release/libs/thread/doc/futures.qbk
==============================================================================
--- branches/release/libs/thread/doc/futures.qbk (original)
+++ branches/release/libs/thread/doc/futures.qbk 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,5 +1,5 @@
 [/
- (C) Copyright 2008-9 Anthony Williams.
+ (C) Copyright 2008-11 Anthony Williams.
   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).

Modified: branches/release/libs/thread/doc/mutex_concepts.qbk
==============================================================================
--- branches/release/libs/thread/doc/mutex_concepts.qbk (original)
+++ branches/release/libs/thread/doc/mutex_concepts.qbk 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,5 +1,6 @@
 [/
   (C) Copyright 2007-8 Anthony Williams.
+ (C) Copyright 2011-12 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).
@@ -17,58 +18,86 @@
 __shared_lockable_concept_type__ and __upgrade_lockable_concept_type__. Each mutex type implements one or more of these concepts, as
 do the various lock types.
 
-[section:lockable `Lockable` Concept]
+[section:basic_lockable `BasicLockable` Concept]
 
-The __lockable_concept__ models exclusive ownership. A type that implements the __lockable_concept__ shall provide the following
-member functions:
+The __BasicLockable concept models exclusive ownership.
+A type `L` meets the __BasicLockable requiremets if the following expressions are well-formed and have the specified semantics (`m` denotes a value of type `L`):
 
-* [lock_ref_link `void lock();`]
-* [try_lock_ref_link `bool try_lock();`]
-* [unlock_ref_link `void unlock();`]
+* `m.__lock();`
+* `m.__unlock();`
 
-Lock ownership acquired through a call to __lock_ref__ or __try_lock_ref__ must be released through a call to __unlock_ref__.
+Lock ownership acquired through a call to __lock_ref__ must be released through a call to __unlock_ref__.
 
-[section:lock `void lock()`]
+[section:lock `m.lock();`]
 
 [variablelist
 
 [[Effects:] [The current thread blocks until ownership can be obtained for the current thread.]]
 
-[[Postcondition:] [The current thread owns `*this`.]]
+[[Postcondition:] [The current thread owns `m`.]]
+
+[[Return type:] [`void`.]]
 
 [[Throws:] [__thread_resource_error__ if an error occurs.]]
 
+[[Error Conditions:] [
+
+[*operation_not_permitted]: if the thread does not have the privilege to perform the operation.
+
+[*resource_deadlock_would_occur]: if the implementation detects that a deadlock would occur.
+
+[*device_or_resource_busy]: if the mutex is already locked and blocking is not possible.
+
+]]
+
+[[Thread safety:] [If an exception is thrown then a lock shall not have been acquired for the current thread.]]
+
 ]
 [endsect]
 
-[section:try_lock `bool try_lock()`]
+[section:unlock `m.unlock();`]
 
 [variablelist
 
-[[Effects:] [Attempt to obtain ownership for the current thread without blocking.]]
+[[Precondition:] [The current thread owns `m`.]]
 
-[[Returns:] [`true` if ownership was obtained for the current thread, `false` otherwise.]]
+[[Effects:] [Releases ownership by the current thread.]]
 
-[[Postcondition:] [If the call returns `true`, the current thread owns the `*this`.]]
+[[Return type:] [`void`.]]
 
-[[Throws:] [__thread_resource_error__ if an error occurs.]]
+[[Postcondition:] [The current thread no longer owns `m`.]]
 
+[[Throws:] [Nothing.]]
 ]
 [endsect]
 
-[section:unlock `void unlock()`]
+
+[endsect]
+[section:lockable `Lockable` Concept]
+
+A type `L` meets the __Lockable requirements if it meets the __BasicLocable requirements and the following expressions are well-formed and have the specified semantics (`m` denotes a value of type `L`):
+
+* `m.__try_lock()`
+
+Lock ownership acquired through a call to __try_lock_ref__ must be released through a call to __unlock_ref__.
+
+[section:try_lock `m.try_lock()`]
 
 [variablelist
 
-[[Precondition:] [The current thread owns `*this`.]]
+[[Effects:] [Attempt to obtain ownership for the current thread without blocking.]]
 
-[[Effects:] [Releases ownership by the current thread.]]
+[[Return type:] [`bool`.]]
 
-[[Postcondition:] [The current thread no longer owns `*this`.]]
+[[Returns:] [`true` if ownership was obtained for the current thread, `false` otherwise.]]
+
+[[Postcondition:] [If the call returns `true`, the current thread owns the `m`.]]
+
+[[Throws:] [Nothing.]]
 
-[[Throws:] [Nothing]]
 ]
 [endsect]
+
 [endsect]
 
 [section:timed_lockable `TimedLockable` Concept]
@@ -76,16 +105,62 @@
 The __timed_lockable_concept__ refines the __lockable_concept__ to add support for
 timeouts when trying to acquire the lock.
 
-A type that implements the __timed_lockable_concept__ shall meet the requirements
-of the __lockable_concept__. In addition, the following member functions must be
-provided:
+A type `L` meets the __TimedLockable requirements if it meets the __Lockable requirements and the following expressions are well-formed and have the specified semantics.
+
+[*Variables:]
+
+* `m` denotes a value of type `L`,
+* `rel_time` denotes a value of an instantiation of `chrono::duration`, and
+* `abs_time` denotes a value of an instantiation of `chrono::time_point`:
+
+[*Expressions:]
+
+* `m.__try_lock_for(rel_time)`
+* `m.__try_lock_until(abs_time)`
 
-* [timed_lock_ref_link `bool timed_lock(boost::system_time const& abs_time);`]
-* [timed_lock_duration_ref_link `template<typename DurationType> bool timed_lock(DurationType const& rel_time);`]
+Lock ownership acquired through a call to __try_lock_for or __try_lock_until must be released through a call to __unlock.
+
+[section:try_lock_until `m.try_lock_until(abs_time)`]
+
+[variablelist
+
+[[Effects:] [Attempt to obtain ownership for the current thread. Blocks until ownership can be obtained, or the specified time is
+reached. If the specified time has already passed, behaves as __try_lock_ref__.]]
+
+[[Returns:] [`true` if ownership was obtained for the current thread, `false` otherwise.]]
+
+[[Postcondition:] [If the call returns `true`, the current thread owns `m`.]]
+
+[[Throws:] [Nothing.]]
+]
+[endsect]
+
+[section:try_lock_for `m.try_lock_for(rel_time)`]
+
+[variablelist
+
+[[Effects:] [As-if `__try_lock_until(chrono::steady_clock::now() + rel_time)`.]]
+
+]
+[endsect]
+
+[heading Deprecated V3.0.0]
+
+The following expressions were required on version 2, but are now deprecated.
+
+[*Variables:]
+
+* `rel_time` denotes a value of an instantiation of an unspecified `DurationType` arithmetic compatible with `boost::system_time`, and
+* `abs_time` denotes a value of an instantiation of `boost::system_time`:
+
+[*Expressions:]
+
+* `m.__timed_lock_duration(rel_time)`
+* `m.__timed_lock(abs_time)`
 
 Lock ownership acquired through a call to __timed_lock_ref__ must be released through a call to __unlock_ref__.
 
-[section:timed_lock `bool timed_lock(boost::system_time const& abs_time)`]
+[section:timed_lock `m.timed_lock(abs_time)`]
 
 [variablelist
 
@@ -94,14 +169,13 @@
 
 [[Returns:] [`true` if ownership was obtained for the current thread, `false` otherwise.]]
 
-[[Postcondition:] [If the call returns `true`, the current thread owns `*this`.]]
+[[Postcondition:] [If the call returns `true`, the current thread owns `m`.]]
 
 [[Throws:] [__thread_resource_error__ if an error occurs.]]
 ]
 [endsect]
 
-[section:timed_lock_duration `template<typename DurationType> bool
-timed_lock(DurationType const& rel_time)`]
+[section:timed_lock_duration `m.timed_lock(rel_time)`]
 
 [variablelist
 
@@ -111,6 +185,7 @@
 ]
 [endsect]
 
+
 [endsect]
 
 [section:shared_lockable `SharedLockable` Concept]
@@ -122,32 +197,38 @@
 can have shared or exclusive ownership. Alternatively, many threads may have
 shared ownership.
 
-For a type to implement the __shared_lockable_concept__, as well as meeting the
-requirements of the __timed_lockable_concept__, it must also provide the following
-member functions:
-
-* [lock_shared_ref_link `void lock_shared();`]
-* [try_lock_shared_ref_link `bool try_lock_shared();`]
-* [unlock_shared_ref_link `bool unlock_shared();`]
-* [timed_lock_shared_ref_link `bool timed_lock_shared(boost::system_time const& abs_time);`]
+A type `L` meets the __SharedLockable requirements if it meets the __TimedLockable requirements and the following expressions are well-formed and have the specified semantics.
+
+[*Variables:]
+
+* `m` denotes a value of type `L`,
+* `rel_time` denotes a value of an instantiation of `chrono::duration`, and
+* `abs_time` denotes a value of an instantiation of `chrono::time_point`:
+
+[*Expressions:]
+
+* `m.__lock_shared();`
+* `m.__try_lock_shared()`
+* `m.__try_lock_shared_for(rel_time)`
+* `m.__try_lock_shared_until(abs_time)`
+* `m.__unlock_shared();`
 
-Lock ownership acquired through a call to __lock_shared_ref__, __try_lock_shared_ref__ or __timed_lock_shared_ref__ must be released
-through a call to __unlock_shared_ref__.
+Lock ownership acquired through a call to __lock_shared_ref__, __try_lock_shared_ref__, __try_lock_shared_for or __try_lock_shared_until must be released through a call to __unlock_shared_ref__.
 
-[section:lock_shared `void lock_shared()`]
+[section:lock_shared `m.lock_shared()`]
 
 [variablelist
 
 [[Effects:] [The current thread blocks until shared ownership can be obtained for the current thread.]]
 
-[[Postcondition:] [The current thread has shared ownership of `*this`.]]
+[[Postcondition:] [The current thread has shared ownership of `m`.]]
 
 [[Throws:] [__thread_resource_error__ if an error occurs.]]
 
 ]
 [endsect]
 
-[section:try_lock_shared `bool try_lock_shared()`]
+[section:try_lock_shared `m.try_lock_shared()`]
 
 [variablelist
 
@@ -155,14 +236,31 @@
 
 [[Returns:] [`true` if shared ownership was obtained for the current thread, `false` otherwise.]]
 
-[[Postcondition:] [If the call returns `true`, the current thread has shared ownership of `*this`.]]
+[[Postcondition:] [If the call returns `true`, the current thread has shared ownership of `m`.]]
+
+[[Throws:] [__thread_resource_error__ if an error occurs.]]
+
+]
+[endsect]
+
+[section:try_lock_shared_for `m.try_lock_shared_for(rel_time)`]
+
+[variablelist
+
+[[Effects:] [Attempt to obtain shared ownership for the current thread. Blocks until shared ownership can be obtained, or the
+specified duration is elapsed. If the specified duration is already elapsed, behaves as __try_lock_shared_ref__.]]
+
+[[Returns:] [`true` if shared ownership was acquired for the current thread, `false` otherwise.]]
+
+[[Postcondition:] [If the call returns `true`, the current thread has shared
+ownership of `m`.]]
 
 [[Throws:] [__thread_resource_error__ if an error occurs.]]
 
 ]
 [endsect]
 
-[section:timed_lock_shared `bool timed_lock_shared(boost::system_time const& abs_time)`]
+[section:try_lock_shared_until `m.try_lock_shared_until(abs_time))`]
 
 [variablelist
 
@@ -172,28 +270,60 @@
 [[Returns:] [`true` if shared ownership was acquired for the current thread, `false` otherwise.]]
 
 [[Postcondition:] [If the call returns `true`, the current thread has shared
-ownership of `*this`.]]
+ownership of `m`.]]
 
 [[Throws:] [__thread_resource_error__ if an error occurs.]]
 
 ]
 [endsect]
 
-[section:unlock_shared `void unlock_shared()`]
+[section:unlock_shared `m.unlock_shared()`]
 
 [variablelist
 
-[[Precondition:] [The current thread has shared ownership of `*this`.]]
+[[Precondition:] [The current thread has shared ownership of `m`.]]
 
-[[Effects:] [Releases shared ownership of `*this` by the current thread.]]
+[[Effects:] [Releases shared ownership of `m` by the current thread.]]
 
-[[Postcondition:] [The current thread no longer has shared ownership of `*this`.]]
+[[Postcondition:] [The current thread no longer has shared ownership of `m`.]]
 
 [[Throws:] [Nothing]]
 
 ]
 [endsect]
 
+[heading Deprecated V3]
+
+The following expressions were required on version 1, but are now deprecated.
+
+[*Variables:]
+
+* `abs_time` denotes a value of an instantiation of `boost::system_time`:
+
+[*Expressions:]
+
+* `m.timed_lock_shared(abs_time);`
+
+Lock ownership acquired through a call to __timed_lock_shared_ref__ must be released through a call to __unlock_shared_ref__.
+
+[section:timed_lock_shared `m.timed_lock_shared(abs_time)`]
+
+[variablelist
+
+[[Effects:] [Attempt to obtain shared ownership for the current thread. Blocks until shared ownership can be obtained, or the
+specified time is reached. If the specified time has already passed, behaves as __try_lock_shared_ref__.]]
+
+[[Returns:] [`true` if shared ownership was acquired for the current thread, `false` otherwise.]]
+
+[[Postcondition:] [If the call returns `true`, the current thread has shared
+ownership of `m`.]]
+
+[[Throws:] [__thread_resource_error__ if an error occurs.]]
+
+]
+[endsect]
+
+
 
 [endsect]
 
@@ -213,91 +343,441 @@
 __upgrade_lockable_concept__ can be downgraded to upgradable ownership or shared ownership, and upgradable ownership can be
 downgraded to plain shared ownership.
 
-For a type to implement the __upgrade_lockable_concept__, as well as meeting the
-requirements of the __shared_lockable_concept__, it must also provide the following
-member functions:
-
-* [lock_upgrade_ref_link `void lock_upgrade();`]
-* [unlock_upgrade_ref_link `bool unlock_upgrade();`]
-* [unlock_upgrade_and_lock_ref_link `void unlock_upgrade_and_lock();`]
-* [unlock_and_lock_upgrade_ref_link `void unlock_and_lock_upgrade();`]
-* [unlock_upgrade_and_lock_shared_ref_link `void unlock_upgrade_and_lock_shared();`]
+A type `L` meets the __SharedLockable requirements if it meets the __TimedLockable requirements and the following expressions are well-formed and have the specified semantics.
+
+[*Variables:]
+
+* `m` denotes a value of type `L`,
+* `rel_time` denotes a value of an instantiation of `chrono::duration`, and
+* `abs_time` denotes a value of an instantiation of `chrono::time_point`:
+
+[*Expressions:]
+
+* `m.__lock_upgrade();`
+* `m.__unlock_upgrade()`
+* `m.__try_lock_upgrade()`
+* `m.__try_lock_upgrade_for(rel_time)`
+* `m.__try_lock_upgrade_until(abs_time)`
+* `m.__unlock_and_lock_shared()`
+* `m.__unlock_and_lock_upgrade();`
+* `m.__unlock_upgrade_and_lock();`]
+* `m.__try_unlock_upgrade_and_lock()`
+* `m.__try_unlock_upgrade_and_lock_for(rel_time)`
+* `m.__try_unlock_upgrade_and_lock_until(abs_time)`
+* `m.__unlock_upgrade_and_lock_shared();`
+
+
+If `BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION is defined the following expressions are also required:
+
+* `m.__try_unlock_shared_and_lock();`
+* `m.__try_unlock_shared_and_lock_for(rel_time);`
+* `m.__try_unlock_shared_and_lock_until(abs_time);`
+* `m.__try_unlock_shared_and_lock_upgrade();`
+* `m.__try_unlock_shared_and_lock_upgrade_for(rel_time);`
+* `m.__try_unlock_shared_and_lock_upgrade_until(abs_time);`
+
 
 Lock ownership acquired through a call to __lock_upgrade_ref__ must be released through a call to __unlock_upgrade_ref__. If the
 ownership type is changed through a call to one of the `unlock_xxx_and_lock_yyy()` functions, ownership must be released through a
 call to the unlock function corresponding to the new level of ownership.
 
 
-[section:lock_upgrade `void lock_upgrade()`]
+[section:lock_upgrade `m.lock_upgrade()`]
+
+[variablelist
+
+[[Precondition:] [The calling thread has no ownership of the mutex. ]]
+
+[[Effects:] [The current thread blocks until upgrade ownership can be obtained for the current thread.]]
+
+[[Postcondition:] [The current thread has upgrade ownership of `m`.]]
+
+[[Synchronization:] [Prior `__unlock_upgrade()` operations on the same object synchronize with this operation.]]
+
+[[Throws:] [__thread_resource_error__ if an error occurs.]]
+
+]
+[endsect]
+
+[section:unlock_upgrade `m.unlock_upgrade()`]
+
+[variablelist
+
+[[Precondition:] [The current thread has upgrade ownership of `m`.]]
+
+[[Effects:] [Releases upgrade ownership of `m` by the current thread.]]
+
+[[Postcondition:] [The current thread no longer has upgrade ownership of `m`.]]
+
+[[Synchronization:] [This operation synchronizes with subsequent lock operations that obtain ownership on the same object.]]
+
+[[Throws:] [Nothing]]
+
+]
+[endsect]
+
+[section:try_lock_upgrade `m.try_lock_upgrade()`]
+
+[variablelist
+
+[[Precondition:] [The calling thread has no ownership of the mutex. ]]
+
+[[Effects:] [Attempts to obtain upgrade ownership of the mutex for the calling thread without blocking. If upgrade ownership is not obtained, there is no effect and try_lock_upgrade() immediately returns.]]
+
+[[Returns:] [`true` if upgrade ownership was acquired for the current thread, `false` otherwise.]]
+
+[[Postcondition:] [If the call returns `true`, the current thread has upgrade ownership of `m`.]]
+
+[[Synchronization:] [If `__try_lock_upgrade()` returns true, prior `__unlock_upgrade()` operations on the same object synchronize with this operation.]]
+
+[[Throws:] [Nothing]]
+
+]
+[endsect]
+
+
+[section:try_lock_upgrade_for `m.try_lock_upgrade_for(rel_time)`]
+
+[variablelist
+
+[[Precondition:] [The calling thread has no ownership of the mutex. ]]
+
+[[Effects:] [If the tick period of `rel_time` is not exactly convertible to the native tick period, the duration shall be rounded up to the nearest native tick period.
+Attempts to obtain upgrade lock ownership for the calling thread within the relative timeout specified by `rel_time`.
+If the time specified by `rel_time` is less than or equal to `rel_time.zero()`, the function attempts to obtain ownership without blocking (as if by calling `__try_lock_upgrade()`).
+The function returns within the timeout specified by `rel_time` only if it has obtained upgrade ownership of the mutex object.]]
+
+[[Returns:] [`true` if upgrade ownership was acquired for the current thread, `false` otherwise.]]
+
+[[Postcondition:] [If the call returns `true`, the current thread has upgrade ownership of `m`.]]
+
+[[Synchronization:] [If `__try_lock_upgrade_for(rel_time)` returns true, prior `__unlock_upgrade()` operations on the same object synchronize with this operation.]]
+
+[[Throws:] [Nothing]]
+
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
+]
+[endsect]
+
+[section:try_lock_upgrade_until `m.try_lock_upgrade_until(abs_time)`]
+
+[variablelist
+
+[[Precondition:] [The calling thread has no ownership of the mutex. ]]
+
+[[Effects:] [The function attempts to obtain upgrade ownership of the mutex.
+If `abs_time` has already passed, the function attempts to obtain upgrade ownership without blocking (as if by calling `__try_lock_upgrade()`).
+The function returns before the absolute timeout specified by `abs_time` only if it has obtained upgrade ownership of the mutex object.]]
+
+[[Returns:] [`true` if upgrade ownership was acquired for the current thread, `false` otherwise.]]
+
+[[Postcondition:] [If the call returns `true`, the current thread has upgrade ownership of `m`.]]
+
+[[Synchronization:] [If `__try_lock_upgrade_until(abs_time)` returns true, prior `__unlock_upgrade()` operations on the same object synchronize with this operation.]]
+
+[[Throws:] [Nothing]]
+
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
+]
+[endsect]
+
+
+[section:try_unlock_shared_and_lock `m.try_unlock_shared_and_lock()`]
+
+[variablelist
+
+[[Precondition:] [The calling thread must hold a shared lock on the mutex.]]
+
+[[Effects:] [The function attempts to atomically convert the ownership from shared to exclusive for the calling thread without blocking.
+For this conversion to be successful, this thread must be the only thread holding any ownership of the lock.
+If the conversion is not successful, the shared ownership of m is retained.]]
+
+[[Returns:] [`true` if exclusive ownership was acquired for the current thread, `false` otherwise.]]
+
+[[Postcondition:] [If the call returns `true`, the current thread has exclusive ownership of `m`.]]
+
+[[Synchronization:] [If `__try_unlock_shared_and_lock()` returns true, prior `__unlock()` and subsequent lock operations on the same object synchronize with this operation. ]]
+
+
+[[Throws:] [Nothing]]
+
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION` and `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
+]
+[endsect]
+
+[section:try_unlock_shared_and_lock_for `m.try_unlock_shared_and_lock_for(rel_time)`]
+
+[variablelist
+
+[[Precondition:] [The calling thread shall hold a shared lock on the mutex.]]
+
+[[Effects:] [If the tick period of `rel_time` is not exactly convertible to the native tick period, the duration shall be rounded up to the nearest native tick period.
+The function attempts to atomically convert the ownership from shared to exclusive for the calling thread within the relative timeout specified by `rel_time`.
+If the time specified by `rel_time` is less than or equal to `rel_time.zero()`, the function attempts to obtain exclusive ownership without blocking (as if by calling `try_unlock_shared_and_lock()`).
+The function shall return within the timeout specified by `rel_time` only if it has obtained exclusive ownership of the mutex object.
+For this conversion to be successful, this thread must be the only thread holding any ownership of the lock at the moment of conversion.
+If the conversion is not successful, the shared ownership of the mutex is retained.]]
+
+[[Returns:] [`true` if exclusive ownership was acquired for the current thread, `false` otherwise.]]
+
+[[Postcondition:] [If the call returns `true`, the current thread has exclusive ownership of `m`.]]
+
+[[Synchronization:] [If `__try_unlock_shared_and_lock_for(rel_time)` returns true, prior `__unlock()` and subsequent lock operations on the same object synchronize with this operation. ]]
+
+[[Throws:] [Nothing]]
+
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION` and `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
+]
+[endsect]
+
+
+[section:try_unlock_shared_and_lock_until `m.try_unlock_shared_and_lock_until(abs_time)`]
+
+[variablelist
+
+[[Precondition:] [The calling thread shall hold a shared lock on the mutex.]]
+
+[[Effects:] [The function attempts to atomically convert the ownership from shared to exclusive for the calling thread within the absolute timeout specified by `abs_time`.
+If `abs_time` has already passed, the function attempts to obtain exclusive ownership without blocking (as if by calling `try_unlock_shared_and_lock()`).
+The function shall return before the absolute timeout specified by `abs_time` only if it has obtained exclusive ownership of the mutex object.
+For this conversion to be successful, this thread must be the only thread holding any ownership of the lock at the moment of conversion.
+If the conversion is not successful, the shared ownership of the mutex is retained.]]
+
+[[Returns:] [`true` if exclusive ownership was acquired for the current thread, `false` otherwise.]]
+
+[[Postcondition:] [If the call returns `true`, the current thread has exclusive ownership of `m`.]]
+
+[[Synchronization:] [If `__try_unlock_shared_and_lock_until(rel_time)` returns true, prior `__unlock()` and subsequent lock operations on the same object synchronize with this operation. ]]
+
+[[Throws:] [Nothing]]
+
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION` and `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
+]
+[endsect]
+
+[section:unlock_and_lock_shared `m.unlock_and_lock_shared()`]
+
+[variablelist
+
+[[Precondition:] [The calling thread shall hold an exclusive lock on `m`.]]
+
+[[Effects:] [Atomically converts the ownership from exclusive to shared for the calling thread.]]
+
+[[Postcondition:] [The current thread has shared ownership of `m`.]]
+
+[[Synchronization:] [This operation synchronizes with subsequent lock operations that obtain ownership of the same object.]]
+
+[[Throws:] [Nothing]]
+
+]
+[endsect]
+
+[section:try_unlock_shared_and_lock_upgrade `m.try_unlock_shared_and_lock_upgrade()`]
+
+[variablelist
+
+[[Precondition:] [The calling thread shall hold a shared lock on the mutex.]]
+
+[[Effects:] [The function attempts to atomically convert the ownership from shared to upgrade for the calling thread without blocking.
+For this conversion to be successful, there must be no thread holding upgrade ownership of this object.
+If the conversion is not successful, the shared ownership of the mutex is retained.]]
+
+[[Returns:] [`true` if upgrade ownership was acquired for the current thread, `false` otherwise.]]
+
+[[Postcondition:] [If the call returns `true`, the current thread has upgrade ownership of `m`.]]
+
+[[Synchronization:] [If `__try_unlock_shared_and_lock_upgrade()` returns true, prior `__unlock_upgrade()` and subsequent lock operations on the same object synchronize with this operation. ]]
+
+[[Throws:] [Nothing]]
+
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION` and `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
+]
+[endsect]
+
+
+[section:try_unlock_shared_and_lock_upgrade_for `m.try_unlock_shared_and_lock_upgrade_for(rel_time)`]
+
+[variablelist
+
+[[Precondition:] [The calling thread shall hold a shared lock on the mutex.]]
+
+[[Effects:] [If the tick period of `rel_time` is not exactly convertible to the native tick period, the duration shall be rounded up to the nearest native tick period.
+The function attempts to atomically convert the ownership from shared to upgrade for the calling thread within the relative timeout specified by `rel_time`.
+If the time specified by `rel_time` is less than or equal to `rel_time.zero()`, the function attempts to obtain upgrade ownership without blocking (as if by calling `__try_unlock_shared_and_lock_upgrade()`).
+The function shall return within the timeout specified by `rel_time` only if it has obtained exclusive ownership of the mutex object.
+For this conversion to be successful, there must be no thread holding upgrade ownership of this object at the moment of conversion.
+If the conversion is not successful, the shared ownership of m is retained.]]
+
+[[Returns:] [`true` if upgrade ownership was acquired for the current thread, `false` otherwise.]]
+
+[[Postcondition:] [If the call returns `true`, the current thread has upgrade ownership of `m`.]]
+
+[[Synchronization:] [If `__try_unlock_shared_and_lock_upgrade_for(rel_time)` returns true, prior `__unlock_upgrade()` and subsequent lock operations on the same object synchronize with this operation. ]]
+
+[[Throws:] [Nothing]]
+
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION` and `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
+
+]
+[endsect]
+
+[section:try_unlock_shared_and_lock_upgrade_until `m.try_unlock_shared_and_lock_upgrade_until(abs_time)`]
+
+[variablelist
+
+[[Precondition:] [The calling thread shall hold a shared lock on the mutex.]]
+
+[[Effects:] [The function attempts to atomically convert the ownership from shared to upgrade for the calling thread within the absolute timeout specified by `abs_time`.
+If `abs_time` has already passed, the function attempts to obtain upgrade ownership without blocking (as if by calling `__try_unlock_shared_and_lock_upgrade()`).
+The function shall return before the absolute timeout specified by `abs_time` only if it has obtained upgrade ownership of the mutex object.
+For this conversion to be successful, there must be no thread holding upgrade ownership of this object at the moment of conversion.
+If the conversion is not successful, the shared ownership of the mutex is retained.]]
+
+[[Returns:] [`true` if upgrade ownership was acquired for the current thread, `false` otherwise.]]
+
+[[Postcondition:] [If the call returns `true`, the current thread has upgrade ownership of `m`.]]
+
+[[Synchronization:] [If `__try_unlock_shared_and_lock_upgrade_until(rel_time)` returns true, prior `__unlock_upgrade()` and subsequent lock operations on the same object synchronize with this operation. ]]
+
+[[Throws:] [Nothing]]
+
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION` and `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
+]
+[endsect]
+
+[section:unlock_and_lock_upgrade `m.unlock_and_lock_upgrade()`]
+
+[variablelist
+
+[[Precondition:] [The current thread has exclusive ownership of `m`.]]
+
+[[Effects:] [Atomically releases exclusive ownership of `m` by the current thread and acquires upgrade ownership of `m`
+without blocking.]]
+
+[[Postcondition:] [The current thread has upgrade ownership of `m`.]]
+
+[[Synchronization:] [This operation synchronizes with subsequent lock operations that obtain ownership of the same object.]]
+
+[[Throws:] [Nothing]]
+
+]
+[endsect]
+
+
+[section:unlock_upgrade_and_lock `m.unlock_upgrade_and_lock()`]
 
 [variablelist
 
-[[Effects:] [The current thread blocks until upgrade ownership can be obtained for the current thread.]]
+[[Precondition:] [The current thread has upgrade ownership of `m`.]]
+
+[[Effects:] [Atomically releases upgrade ownership of `m` by the current thread and acquires exclusive ownership of `m`. If
+any other threads have shared ownership, blocks until exclusive ownership can be acquired.]]
 
-[[Postcondition:] [The current thread has upgrade ownership of `*this`.]]
+[[Postcondition:] [The current thread has exclusive ownership of `m`.]]
 
-[[Throws:] [__thread_resource_error__ if an error occurs.]]
+[[Synchronization:] [This operation synchronizes with prior `__unlock_shared()` and subsequent lock operations that obtain ownership of the same object.]]
+
+[[Throws:] [Nothing]]
 
 ]
 [endsect]
 
-[section:unlock_upgrade `void unlock_upgrade()`]
+[section:try_unlock_upgrade_and_lock `m.try_unlock_upgrade_and_lock()`]
 
 [variablelist
 
-[[Precondition:] [The current thread has upgrade ownership of `*this`.]]
+[[Precondition:] [The calling thread shall hold a upgrade lock on the mutex.]]
+
+[[Effects:] [The function attempts to atomically convert the ownership from upgrade to exclusive for the calling thread without blocking.
+For this conversion to be successful, this thread must be the only thread holding any ownership of the lock.
+If the conversion is not successful, the upgrade ownership of m is retained.]]
+
+[[Returns:] [`true` if exclusive ownership was acquired for the current thread, `false` otherwise.]]
 
-[[Effects:] [Releases upgrade ownership of `*this` by the current thread.]]
+[[Postcondition:] [If the call returns `true`, the current thread has exclusive ownership of `m`.]]
 
-[[Postcondition:] [The current thread no longer has upgrade ownership of `*this`.]]
+[[Synchronization:] [If `__try_unlock_upgrade_and_lock()` returns true, prior `__unlock()` and subsequent lock operations on the same object synchronize with this operation. ]]
 
 [[Throws:] [Nothing]]
 
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
+
 ]
 [endsect]
 
-[section:unlock_upgrade_and_lock `void unlock_upgrade_and_lock()`]
+[section:try_unlock_upgrade_and_lock_for `m.try_unlock_upgrade_and_lock_for(rel_time)`]
 
 [variablelist
 
-[[Precondition:] [The current thread has upgrade ownership of `*this`.]]
+[[Precondition:] [The calling thread shall hold a upgrade lock on the mutex.]]
 
-[[Effects:] [Atomically releases upgrade ownership of `*this` by the current thread and acquires exclusive ownership of `*this`. If
-any other threads have shared ownership, blocks until exclusive ownership can be acquired.]]
+[[Effects:] [If the tick period of `rel_time` is not exactly convertible to the native tick period, the duration shall be rounded up to the nearest native tick period.
+The function attempts to atomically convert the ownership from upgrade to exclusive for the calling thread within the relative timeout specified by `rel_time`.
+If the time specified by `rel_time` is less than or equal to `rel_time.zero()`, the function attempts to obtain exclusive ownership without blocking (as if by calling `__try_unlock_upgrade_and_lock()`).
+The function shall return within the timeout specified by `rel_time` only if it has obtained exclusive ownership of the mutex object.
+For this conversion to be successful, this thread shall be the only thread holding any ownership of the lock at the moment of conversion.
+If the conversion is not successful, the upgrade ownership of m is retained.]]
+
+[[Returns:] [`true` if exclusive ownership was acquired for the current thread, `false` otherwise.]]
 
-[[Postcondition:] [The current thread has exclusive ownership of `*this`.]]
+[[Postcondition:] [If the call returns `true`, the current thread has exclusive ownership of `m`.]]
+
+[[Synchronization:] [If `__try_unlock_upgrade_and_lock_for(rel_time)` returns true, prior `__unlock()` and subsequent lock operations on the same object synchronize with this operation. ]]
 
 [[Throws:] [Nothing]]
 
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
 ]
 [endsect]
 
-[section:unlock_upgrade_and_lock_shared `void unlock_upgrade_and_lock_shared()`]
+[section:try_unlock_upgrade_and_lock_until `m.try_unlock_upgrade_and_lock_until(abs_time)`]
 
 [variablelist
 
-[[Precondition:] [The current thread has upgrade ownership of `*this`.]]
+[[Precondition:] [The calling thread shall hold a upgrade lock on the mutex.]]
 
-[[Effects:] [Atomically releases upgrade ownership of `*this` by the current thread and acquires shared ownership of `*this` without
-blocking.]]
+[[Effects:] [The function attempts to atomically convert the ownership from upgrade to exclusive for the calling thread within the absolute timeout specified by `abs_time`.
+If `abs_time` has already passed, the function attempts to obtain exclusive ownership without blocking (as if by calling `__try_unlock_upgrade_and_lock()`).
+The function shall return before the absolute timeout specified by `abs_time` only if it has obtained exclusive ownership of the mutex object.
+For this conversion to be successful, this thread shall be the only thread holding any ownership of the lock at the moment of conversion.
+If the conversion is not successful, the upgrade ownership of m is retained.]]
+
+[[Returns:] [`true` if exclusive ownership was acquired for the current thread, `false` otherwise.]]
 
-[[Postcondition:] [The current thread has shared ownership of `*this`.]]
+[[Postcondition:] [If the call returns `true`, the current thread has exclusive ownership of `m`.]]
+
+[[Synchronization:] [If `__try_unlock_upgrade_and_lock_for(rel_time)` returns true, prior `__unlock()` and subsequent lock operations on the same object synchronize with this operation. ]]
 
 [[Throws:] [Nothing]]
 
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
 ]
 [endsect]
 
-[section:unlock_and_lock_upgrade `void unlock_and_lock_upgrade()`]
+
+[section:unlock_upgrade_and_lock_shared `m.unlock_upgrade_and_lock_shared()`]
 
 [variablelist
 
-[[Precondition:] [The current thread has exclusive ownership of `*this`.]]
+[[Precondition:] [The current thread has upgrade ownership of `m`.]]
 
-[[Effects:] [Atomically releases exclusive ownership of `*this` by the current thread and acquires upgrade ownership of `*this`
-without blocking.]]
+[[Effects:] [Atomically releases upgrade ownership of `m` by the current thread and acquires shared ownership of `m` without
+blocking.]]
+
+[[Postcondition:] [The current thread has shared ownership of `m`.]]
 
-[[Postcondition:] [The current thread has upgrade ownership of `*this`.]]
+[[Synchronization:] [This operation synchronizes with prior `unlock_shared()` and subsequent lock operations that obtain ownership of the same object.]]
 
 [[Throws:] [Nothing]]
 
@@ -310,6 +790,32 @@
 
 [section:locks Lock Types]
 
+ #include <boost/thread/locks.hpp>
+
+ struct defer_lock_t {};
+ struct try_to_lock_t {};
+ struct adopt_lock_t {};
+ const defer_lock_t defer_lock;
+ const try_to_lock_t try_to_lock;
+ const adopt_lock_t adopt_lock;
+
+ template<typename Lockable>
+ class lock_guard
+ template<typename Lockable>
+ class unique_lock;
+ template<typename Mutex>
+ void swap(unique_lock <Mutex>& lhs, unique_lock <Mutex>& rhs);
+ template<typename Lockable>
+ class shared_lock;
+ template<typename Mutex>
+ void swap(shared_lock<Mutex>& lhs,shared_lock<Mutex>& rhs);
+ template<typename Lockable>
+ class upgrade_lock;
+ template<typename Mutex>
+ void swap(upgrade_lock <Mutex>& lhs, upgrade_lock <Mutex>& rhs);
+ template <class Mutex>
+ class upgrade_to_unique_lock;
+
 [section:lock_tags Lock option tags]
 
   #include <boost/thread/locks.hpp>
@@ -403,41 +909,61 @@
     class unique_lock
     {
     public:
- unique_lock();
+ typedef Lockable mutex_type;
+ unique_lock() noexcept;
         explicit unique_lock(Lockable& m_);
         unique_lock(Lockable& m_,adopt_lock_t);
- unique_lock(Lockable& m_,defer_lock_t);
+ unique_lock(Lockable& m_,defer_lock_t) noexcept;
         unique_lock(Lockable& m_,try_to_lock_t);
- unique_lock(Lockable& m_,system_time const& target_time);
 
+ #ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION
+ unique_lock(shared_lock<mutex_type>&& sl, try_to_lock_t)
+ template <class Clock, class Duration>
+ unique_lock(shared_lock<mutex_type>&& sl,
+ const chrono::time_point<Clock, Duration>& abs_time);
+ template <class Rep, class Period>
+ unique_lock(shared_lock<mutex_type>&& sl,
+ const chrono::duration<Rep, Period>& rel_time)
+ #endif
+
+ template <class Clock, class Duration>
+ unique_lock(Mutex& mtx, const chrono::time_point<Clock, Duration>& t);
+ template <class Rep, class Period>
+ unique_lock(Mutex& mtx, const chrono::duration<Rep, Period>& d);
         ~unique_lock();
 
- unique_lock(detail::thread_move_t<unique_lock<Lockable> > other);
- unique_lock(detail::thread_move_t<upgrade_lock<Lockable> > other);
+ unique_lock(unique_lock const&) = delete;
+ unique_lock& operator=(unique_lock const&) = delete;
+ unique_lock(unique_lock<Lockable>&& other) noexcept;
+ explicit unique_lock(upgrade_lock<Lockable>&& other) noexcept;
 
- operator detail::thread_move_t<unique_lock<Lockable> >();
- detail::thread_move_t<unique_lock<Lockable> > move();
- unique_lock& operator=(detail::thread_move_t<unique_lock<Lockable> > other);
- unique_lock& operator=(detail::thread_move_t<upgrade_lock<Lockable> > other);
+ unique_lock& operator=(unique_lock<Lockable>&& other) noexcept;
 
- void swap(unique_lock& other);
- void swap(detail::thread_move_t<unique_lock<Lockable> > other);
+ void swap(unique_lock& other) noexcept;
+ Lockable* release() noexcept;
 
         void lock();
         bool try_lock();
 
- template<typename TimeDuration>
- bool timed_lock(TimeDuration const& relative_time);
- bool timed_lock(::boost::system_time const& absolute_time);
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
 
         void unlock();
 
- bool owns_lock() const;
- operator ``['unspecified-bool-type]``() const;
- bool operator!() const;
+ explicit operator bool() const noexcept;
+ bool owns_lock() const noexcept;
+
+ Lockable* mutex() const noexcept;
+
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 || defined BOOST_THREAD_DONT_USE_CHRONO
+ unique_lock(Lockable& m_,system_time const& target_time);
+ template<typename TimeDuration>
+ bool timed_lock(TimeDuration const& relative_time);
+ bool timed_lock(::boost::system_time const& absolute_time);
+ #endif
 
- Lockable* mutex() const;
- Lockable* release();
     };
 
 __unique_lock__ is more complex than __lock_guard__: not only does it provide for RAII-style locking, it also allows for deferring
@@ -445,9 +971,10 @@
 fashion, or with a timeout. Consequently, __unlock_ref__ is only called in the destructor if the lock object has locked the
 __lockable_concept_type__ object, or otherwise adopted a lock on the __lockable_concept_type__ object.
 
-Specializations of __unique_lock__ model the __timed_lockable_concept__ if the supplied __lockable_concept_type__ type itself models
-__timed_lockable_concept__ (e.g. `boost::unique_lock<boost::timed_mutex>`), or the __lockable_concept__ otherwise
-(e.g. `boost::unique_lock<boost::mutex>`).
+Specializations of __unique_lock__ model the __TimedLockable concept if the supplied `Lockable` type itself models
+__TimedLockable concept (e.g. `boost::unique_lock<boost::timed_mutex>`), or the __Lockable concept if the supplied `Lockable` type itself models
+__Lockable concept (e.g. `boost::unique_lock<boost::mutex>`), or the __BasicLockable concept if the supplied `Lockable` type itself models
+__BasicLockable concept.
 
 An instance of __unique_lock__ is said to ['own] the lock state of a __lockable_concept_type__ `m` if __mutex_func_ref__ returns a
 pointer to `m` and __owns_lock_ref__ returns `true`. If an object that ['owns] the lock state of a __lockable_concept_type__ object
@@ -533,6 +1060,82 @@
 
 [endsect]
 
+[section:constructor_sh_try `unique_lock(shared_lock<mutex_type>&& sl, try_to_lock_t)`]
+
+[variablelist
+
+[[Requires:] [The supplied `Mutex` type must implement `__try_unlock_shared_and_lock()`.]]
+
+[[Effects:] [Constructs an object of type __unique_lock. Let `pm` be and `owns` the ownership state. Initializes `pm` with nullptr and `owns` with false.
+If `sl.__owns_lock()` returns `false`, sets `pm` to the return value of `sl.release()`.
+Else `sl.__owns_lock()` returns `true`, and in this case if `sl.mutex()->try_unlock_shared_and_lock()` returns `true`, sets `pm` to the value returned by `sl.release()` and sets `owns` to `true`.]]
+
+[[Note:] [If `sl.owns_lock()` returns `true` and `sl.mutex()->try_unlock_shared_and_lock()` returns `false`, `sl` is not modified.]]
+
+[[Throws:] [Nothing.]]
+
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION` and `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
+]
+
+[endsect]
+
+
+[section:constructor_sh_until `unique_lock(shared_lock<mutex_type>&&, const chrono::time_point<Clock, Duration>&)`]
+
+ template <class Clock, class Duration>
+ unique_lock(shared_lock<mutex_type>&& sl,
+ const chrono::time_point<Clock, Duration>& abs_time);
+
+[variablelist
+
+[[Requires:] [The supplied `Mutex` type shall implement `__try_unlock_shared_and_lock_until(abs_time)`.]]
+
+[[Effects:] [Constructs an object of type `__unique_lock`, initializing `pm` with `nullptr` and `owns` with `false`.
+If `sl.__owns_lock()` returns `false`, sets `pm` to the return value of `sl.__release()`.
+Else `sl.owns_lock()` returns `true`, and in this case if `sl.mutex()->__try_unlock_shared_and_lock_until(abs_time)` returns `true`, sets `pm` to the value returned by `sl.release()` and sets `owns` to `true`.]]
+
+[[Note:] [If `sl.owns_lock()` returns `true` and `sl.mutex()-> __try_unlock_shared_and_lock_until(abs_time)` returns `false`, `sl` is not modified.]]
+
+[[Throws:] [Nothing.]]
+
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION` and `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
+]
+
+[endsect]
+
+[section:constructor_sh_for `unique_lock(shared_lock<mutex_type>&&, const chrono::duration<Rep, Period>&)`]
+
+ template <class Rep, class Period>
+ unique_lock(shared_lock<mutex_type>&& sl,
+ const chrono::duration<Rep, Period>& rel_time)
+
+[variablelist
+
+[[Requires:] [The supplied `Mutex` type shall implement `__try_unlock_shared_and_lock_for(rel_time)`.]]
+
+[[Effects:] [Constructs an object of type `__unique_lock`, initializing `pm` with `nullptr` and `owns` with `false`.
+If `sl.__owns_lock()` returns `false`, sets `pm` to the return value of `sl.__release()`.
+Else `sl.owns_lock()` returns `true`, and in this case if `sl.mutex()-> __try_unlock_shared_and_lock_for(rel_time)` returns `true`, sets `pm` to the value returned by `sl.release()` and sets `owns` to `true`.]]
+
+[[Note:] [If `sl.owns_lock()` returns `true` and `sl.mutex()-> __try_unlock_shared_and_lock_for(rel_time)` returns `false`, `sl` is not modified.]]
+
+
+[[Postcondition:] [.]]
+
+[[Throws:] [Nothing.]]
+
+[[Notes:] [Available only if `BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION` and `BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN` is defined on Windows platform]]
+
+]
+
+[endsect]
+
+
+
+
+
 [section:constructor_abs_time `unique_lock(Lockable & m,boost::system_time const& abs_time)`]
 
 [variablelist
@@ -551,6 +1154,43 @@
 
 [endsect]
 
+[section:constructor_time_point `template <class Clock, class Duration> unique_lock(Lockable & m,const chrono::time_point<Clock, Duration>& abs_time)`]
+
+[variablelist
+
+[[Effects:] [Stores a reference to `m`. Invokes
+`m.__try_lock_until(abs_time)`, and takes ownership of the lock state if the call
+returns `true`.]]
+
+[[Postcondition:] [__mutex_func_ref__ returns `&m`. If the call to __try_lock_until
+returned `true`, then __owns_lock_ref__ returns `true`, otherwise __owns_lock_ref__
+returns `false`.]]
+
+[[Throws:] [Any exceptions thrown by the call to `m.__try_lock_until(abs_time)`.]]
+
+]
+
+[endsect]
+
+[section:constructor_duration `template <class Rep, class Period> unique_lock(Lockable & m,const chrono::duration<Rep, Period>& abs_time)`]
+
+
+[variablelist
+
+[[Effects:] [Stores a reference to `m`. Invokes
+`m.__try_lock_for(rel_time)`, and takes ownership of the lock state if the call
+returns `true`.]]
+
+[[Postcondition:] [__mutex_func_ref__ returns `&m`. If the call to __try_lock_for
+returned `true`, then __owns_lock_ref__ returns `true`, otherwise __owns_lock_ref__
+returns `false`.]]
+
+[[Throws:] [Any exceptions thrown by the call to `m.__try_lock_for(rel_time)`.]]
+
+]
+
+[endsect]
+
 [section:destructor `~unique_lock()`]
 
 [variablelist
@@ -590,13 +1230,11 @@
 
 [endsect]
 
-[section:bool_conversion `operator unspecified-bool-type() const`]
+[section:explicit_bool_conversion `explicit operator bool() const`]
 
 [variablelist
 
-[[Returns:] [If __owns_lock_ref__ would return `true`, a value that evaluates to
-`true` in boolean contexts, otherwise a value that evaluates to `false` in
-boolean contexts.]]
+[[Returns:] [`__owns_lock_ref__()`.]]
 
 [[Throws:] [Nothing.]]
 
@@ -604,17 +1242,6 @@
 
 [endsect]
 
-[section:operator_not `bool operator!() const`]
-
-[variablelist
-
-[[Returns:] [`!` __owns_lock_ref__.]]
-
-[[Throws:] [Nothing.]]
-
-]
-
-[endsect]
 
 [section:release `Lockable* release()`]
 
@@ -646,34 +1273,53 @@
     class shared_lock
     {
     public:
+ typedef Lockable mutex_type;
+
+ // Shared locking
         shared_lock();
         explicit shared_lock(Lockable& m_);
         shared_lock(Lockable& m_,adopt_lock_t);
         shared_lock(Lockable& m_,defer_lock_t);
         shared_lock(Lockable& m_,try_to_lock_t);
- shared_lock(Lockable& m_,system_time const& target_time);
- shared_lock(detail::thread_move_t<shared_lock<Lockable> > other);
- shared_lock(detail::thread_move_t<unique_lock<Lockable> > other);
- shared_lock(detail::thread_move_t<upgrade_lock<Lockable> > other);
-
+ template <class Clock, class Duration>
+ shared_lock(Mutex& mtx, const chrono::time_point<Clock, Duration>& t);
+ template <class Rep, class Period>
+ shared_lock(Mutex& mtx, const chrono::duration<Rep, Period>& d);
         ~shared_lock();
 
- operator detail::thread_move_t<shared_lock<Lockable> >();
- detail::thread_move_t<shared_lock<Lockable> > move();
+ shared_lock(shared_lock const&) = delete;
+ shared_lock& operator=(shared_lock const&) = delete;
 
- shared_lock& operator=(detail::thread_move_t<shared_lock<Lockable> > other);
- shared_lock& operator=(detail::thread_move_t<unique_lock<Lockable> > other);
- shared_lock& operator=(detail::thread_move_t<upgrade_lock<Lockable> > other);
- void swap(shared_lock& other);
+ shared_lock(shared_lock<Lockable> && other);
+ shared_lock& operator=(shared_lock<Lockable> && other);
 
         void lock();
         bool try_lock();
- bool timed_lock(boost::system_time const& target_time);
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
         void unlock();
 
- operator ``['unspecified-bool-type]``() const;
- bool operator!() const;
+ // Conversion from upgrade locking
+ explicit shared_lock(upgrade_lock<Lockable> && other);
+
+ // Conversion from exclusive locking
+ explicit shared_lock(unique_lock<Lockable> && other);
+
+ // Setters
+ void swap(shared_lock& other);
+ mutex_type* release() noexcept;
+
+ // Getters
+ explicit operator bool() const;
         bool owns_lock() const;
+ mutex_type mutex() const;
+
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 || defined BOOST_THREAD_DONT_USE_CHRONO
+ shared_lock(Lockable& m_,system_time const& target_time);
+ bool timed_lock(boost::system_time const& target_time);
+ #endif
     };
 
 Like __unique_lock__, __shared_lock__ models the __lockable_concept__, but rather than acquiring unique ownership of the supplied
@@ -825,25 +1471,12 @@
 
 [endsect]
 
-[section:bool_conversion `operator unspecified-bool-type() const`]
-
-[variablelist
-
-[[Returns:] [If __owns_lock_shared_ref__ would return `true`, a value that evaluates to
-`true` in boolean contexts, otherwise a value that evaluates to `false` in
-boolean contexts.]]
-
-[[Throws:] [Nothing.]]
-
-]
-
-[endsect]
 
-[section:operator_not `bool operator!() const`]
+[section:explicit_operator_bool `explicit operator bool() const`]
 
 [variablelist
 
-[[Returns:] [`!` __owns_lock_shared_ref__.]]
+[[Returns:] [__owns_lock_shared_ref__.]]
 
 [[Throws:] [Nothing.]]
 
@@ -881,27 +1514,59 @@
     class upgrade_lock
     {
     public:
- explicit upgrade_lock(Lockable& m_);
+ typedef Lockable mutex_type;
 
- upgrade_lock(detail::thread_move_t<upgrade_lock<Lockable> > other);
- upgrade_lock(detail::thread_move_t<unique_lock<Lockable> > other);
+ // Upgrade locking
 
+ upgrade_lock();
+ explicit upgrade_lock(mutex_type& m_);
+ upgrade_lock(mutex_type& m, defer_lock_t) noexcept;
+ upgrade_lock(mutex_type& m, try_to_lock_t);
+ upgrade_lock(mutex_type& m, adopt_lock_t);
+ template <class Clock, class Duration>
+ upgrade_lock(mutex_type& m,
+ const chrono::time_point<Clock, Duration>& abs_time);
+ template <class Rep, class Period>
+ upgrade_lock(mutex_type& m,
+ const chrono::duration<Rep, Period>& rel_time);
         ~upgrade_lock();
 
- operator detail::thread_move_t<upgrade_lock<Lockable> >();
- detail::thread_move_t<upgrade_lock<Lockable> > move();
-
- upgrade_lock& operator=(detail::thread_move_t<upgrade_lock<Lockable> > other);
- upgrade_lock& operator=(detail::thread_move_t<unique_lock<Lockable> > other);
+ upgrade_lock(const upgrade_lock& other) = delete;
+ upgrade_lock& operator=(const upgrade_lock<Lockable> & other) = delete;
 
- void swap(upgrade_lock& other);
+ upgrade_lock(upgrade_lock<Lockable> && other);
+ upgrade_lock& operator=(upgrade_lock<Lockable> && other);
 
         void lock();
+ bool try_lock();
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
         void unlock();
 
- operator ``['unspecified-bool-type]``() const;
- bool operator!() const;
+ #ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSION
+ // Conversion from shared locking
+ upgrade_lock(shared_lock<mutex_type>&& sl, try_to_lock_t);
+ template <class Clock, class Duration>
+ upgrade_lock(shared_lock<mutex_type>&& sl,
+ const chrono::time_point<Clock, Duration>& abs_time);
+ template <class Rep, class Period>
+ upgrade_lock(shared_lock<mutex_type>&& sl,
+ const chrono::duration<Rep, Period>& rel_time);
+ #endif
+
+ // Conversion from exclusive locking
+ explicit upgrade_lock(unique_lock<Lockable> && other);
+
+ // Setters
+ void swap(upgrade_lock& other);
+ mutex_type* release() noexcept;
+
+ // Getters
+ explicit operator bool() const;
         bool owns_lock() const;
+ mutex_type mutex() const;
     };
 
 Like __unique_lock__, __upgrade_lock__ models the __lockable_concept__, but rather than acquiring unique ownership of the supplied
@@ -917,7 +1582,7 @@
 is destroyed, then the destructor will invoke [unlock_upgrade_ref_link `mutex()->unlock_upgrade()`].
 
 The member functions of __upgrade_lock__ are not thread-safe. In particular, __upgrade_lock__ is intended to model the upgrade
-ownership of a __lockable_concept_type__ object by a particular thread, and the member functions that release ownership of the lock
+ownership of a __upgrade_lockable_concept_type__ object by a particular thread, and the member functions that release ownership of the lock
 state (including the destructor) must be called by the same thread that acquired ownership of the lock state.
 
 [endsect]
@@ -930,16 +1595,19 @@
     class upgrade_to_unique_lock
     {
     public:
+ typedef Lockable mutex_type;
         explicit upgrade_to_unique_lock(upgrade_lock<Lockable>& m_);
-
         ~upgrade_to_unique_lock();
 
- upgrade_to_unique_lock(detail::thread_move_t<upgrade_to_unique_lock<Lockable> > other);
- upgrade_to_unique_lock& operator=(detail::thread_move_t<upgrade_to_unique_lock<Lockable> > other);
+ upgrade_to_unique_lock(upgrade_to_unique_lock const& other) = delete;
+ upgrade_to_unique_lock& operator=(upgrade_to_unique_lock<Lockable> const& other) = delete;
+
+ upgrade_to_unique_lock(upgrade_to_unique_lock<Lockable> && other);
+ upgrade_to_unique_lock& operator=(upgrade_to_unique_lock<Lockable> && other);
+
         void swap(upgrade_to_unique_lock& other);
 
- operator ``['unspecified-bool-type]``() const;
- bool operator!() const;
+ explicit operator bool() const;
         bool owns_lock() const;
     };
 
@@ -972,14 +1640,12 @@
         void lock();
         bool try_lock();
         void unlock();
- bool owns_lock() const;
 
         MutexType* mutex() const;
         MutexType* release();
- bool operator!() const;
 
- typedef ``['unspecified-bool-type]`` bool_type;
- operator bool_type() const;
+ explicit operator bool() const;
+ bool owns_lock() const;
     };
 
 The member typedef `scoped_try_lock` is provided for each distinct
@@ -989,11 +1655,157 @@
 that the constructor that takes a single reference to a mutex will
 call [try_lock_ref_link `m.try_lock()`] rather than `m.lock()`.
 
+[endsect]
+[endsect]
+
+[/
+[section:other_mutex Other Mutex Types]
+
+[section: reverse_mutex Class template `reverse_mutex`]
+
+ #include <boost/thread/reverse_mutex.hpp>
+
+ template<typename BasicLockable>
+ class reverse_mutex
+ {
+ public:
+ typedef BasicLockable mutex_type;
+ reverse_mutex(reverse_mutex const&) = delete;
+ reverse_mutex& operator=(reverse_mutex const&) = delete;
+
+ explicit reverse_mutex(mutex_type& m_);
+ ~reverse_mutex();
+
+ void lock();
+ void unlock();
+ };
+
+__reverse_mutex reverse the operations of a __BasicLockable, that unlocks the lockable when `lock()` is called and locks it when `unlock()` is called.
+
+[endsect]
+[endsect]
+
+]
+
+[section:other_locks Other Lock Types]
+
+
+[section:shared_lock_guard Class template `shared_lock_guard`]
+
+ #include <boost/thread/shared_lock_guard.hpp>
+
+ template<typename SharedLockable>
+ class shared_lock_guard
+ {
+ public:
+ explicit shared_lock_guard(SharedLockable& m_);
+ shared_lock_guard(SharedLockable& m_,boost::adopt_lock_t);
+
+ ~shared_lock_guard();
+ };
+
+__shared_lock_guard is very simple: on construction it
+acquires shared ownership of the implementation of the __shared_lockable_concept__ supplied as
+the constructor parameter. On destruction, the ownership is released. This
+provides simple RAII-style locking of a __shared_lockable_concept_type__ object, to facilitate exception-safe
+shared locking and unlocking.
+In addition, the `__shared_lock_guard_ca(SharedLockable &m, boost::adopt_lock_t)` constructor allows the __shared_lock_guard object to
+take shared ownership of a lock already held by the current thread.
+
+[section:constructor `shared_lock_guard(SharedLockable & m)`]
+
+[variablelist
+
+[[Effects:] [Stores a reference to `m`. Invokes `m.__lock_shared()`.]]
+
+[[Throws:] [Any exception thrown by the call to `m.__lock_shared()`.]]
+
+]
+
+[endsect]
+
+[section:constructor_adopt `shared_lock_guard(SharedLockable & m,boost::adopt_lock_t)`]
+
+[variablelist
+
+[[Precondition:] [The current thread owns a lock on `m` equivalent to one
+obtained by a call to `m.__lock_shared()`.]]
+
+[[Effects:] [Stores a reference to `m`. Takes ownership of the lock state of
+`m`.]]
+
+[[Throws:] [Nothing.]]
+
+]
+
+[endsect]
+
+[section:destructor `~shared_lock_guard()`]
+
+[variablelist
+
+[[Effects:] [Invokes `m.__unlock_shared()` on the __shared_lockable_concept_type__ object passed to the constructor.]]
+
+[[Throws:] [Nothing.]]
+
+]
+
+[endsect]
+
+[endsect]
+
+[section:reverse_lock Class template `reverse_lock`]
+
+ #include <boost/thread/reverse_lock.hpp>
+
+ template<typename Lock>
+ class reverse_lock
+ {
+ public:
+ reverse_lock(reverse_lock const&) = delete;
+ reverse_lock& operator=(reverse_lock const&) = delete;
+
+ explicit reverse_lock(Lock& m_);
+ ~reverse_lock();
+ };
+
+__reverse_lock reverse the operations of a lock: it provide for RAII-style, that unlocks the lock at construction time and lock it at destruction time. In addition, it transfer ownership temporarily, so that the mutex can not be locked using the Lock.
+
+An instance of __reverse_lock doesn't ['own] the lock never.
+
+[section:constructor `reverse_lock(Lock & m)`]
+
+[variablelist
+
+[[Effects:] [Stores a reference to `m`. Invokes `m.__unlock()` if `m` owns his lock and then stores the mutex by calling `m.__release()`.]]
+
+[[Postcondition:] [`!m.__owns_lock() && m.__mutex()==0`.]]
+
+[[Throws:] [Any exception thrown by the call to `m.__unlock()`.]]
+
+]
+
+[endsect]
+
+
+[section:destructor `~reverse_lock()`]
+
+[variablelist
+
+[[Effects:] [Let be mtx the stored mutex*. If not 0 Invokes `mtx->__lock()` and gives again the `mtx` to the `Lock` using the `adopt_lock_t` overload.]]
+
+[[Throws:] [Nothing.]]
+
+]
+
+[endsect]
+
 
 [endsect]
 
 [endsect]
 
+
 [section:lock_functions Lock functions]
 
 [section:lock_multiple Non-member function `lock(Lockable1,Lockable2,...)`]

Modified: branches/release/libs/thread/doc/mutexes.qbk
==============================================================================
--- branches/release/libs/thread/doc/mutexes.qbk (original)
+++ branches/release/libs/thread/doc/mutexes.qbk 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,5 +1,6 @@
 [/
- (C) Copyright 2007-8 Anthony Williams.
+ (C) Copyright 2007-11 Anthony Williams
+ (C) Copyright 2011-12 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).
@@ -75,10 +76,11 @@
         void lock();
         void unlock();
         bool try_lock();
- bool timed_lock(system_time const & abs_time);
 
- template<typename TimeDuration>
- bool timed_lock(TimeDuration const & relative_time);
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& t);
 
         typedef platform-specific-type native_handle_type;
         native_handle_type native_handle();
@@ -86,6 +88,13 @@
         typedef unique_lock<timed_mutex> scoped_timed_lock;
         typedef unspecified-type scoped_try_lock;
         typedef scoped_timed_lock scoped_lock;
+
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 || defined BOOST_THREAD_DONT_USE_CHRONO
+ bool timed_lock(system_time const & abs_time);
+ template<typename TimeDuration>
+ bool timed_lock(TimeDuration const & relative_time);
+ #endif
+
     };
 
 __timed_mutex__ implements the __timed_lockable_concept__ to provide an exclusive-ownership mutex. At most one thread can own the
@@ -181,10 +190,11 @@
         bool try_lock();
         void unlock();
 
- bool timed_lock(system_time const & abs_time);
 
- template<typename TimeDuration>
- bool timed_lock(TimeDuration const & relative_time);
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& t);
 
         typedef platform-specific-type native_handle_type;
         native_handle_type native_handle();
@@ -192,6 +202,13 @@
         typedef unique_lock<recursive_timed_mutex> scoped_lock;
         typedef unspecified-type scoped_try_lock;
         typedef scoped_lock scoped_timed_lock;
+
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 || defined BOOST_THREAD_DONT_USE_CHRONO
+ bool timed_lock(system_time const & abs_time);
+ template<typename TimeDuration>
+ bool timed_lock(TimeDuration const & relative_time);
+ #endif
+
     };
 
 __recursive_timed_mutex__ implements the __timed_lockable_concept__ to provide an exclusive-ownership recursive mutex. At most one

Modified: branches/release/libs/thread/doc/once.qbk
==============================================================================
--- branches/release/libs/thread/doc/once.qbk (original)
+++ branches/release/libs/thread/doc/once.qbk 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -7,16 +7,37 @@
 
 [section:once One-time Initialization]
 
+ #include <boost/thread/once.hpp>
+
+ namespace boost
+ {
+ struct once_flag;
+ template<typename Callable>
+ void call_once(once_flag& flag,Callable func);
+
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
+ void call_once(void (*func)(),once_flag& flag);
+ #endif
+
+ }
+
 `boost::call_once` provides a mechanism for ensuring that an initialization routine is run exactly once without data races or deadlocks.
 
 [section:once_flag Typedef `once_flag`]
 
- #include <boost/thread/once.hpp>
-
+ #ifdef BOOST_THREAD_PROVIDES_ONCE_CXX11
+ struct once_flag
+ {
+ constexprr once_flag() noexcept;
+ once_flag(const once_flag&) = delete;
+ once_flag& operator=(const once_flag&) = delete;
+ };
+ #else
     typedef platform-specific-type once_flag;
     #define BOOST_ONCE_INIT platform-specific-initializer
+ #endif
 
-Objects of type `boost::once_flag` shall be initialized with `BOOST_ONCE_INIT`:
+Objects of type `boost::once_flag` shall be initialized with `BOOST_ONCE_INIT` if BOOST_THREAD_PROVIDES_ONCE_CXX11 is not defined
 
     boost::once_flag f=BOOST_ONCE_INIT;
 
@@ -24,8 +45,6 @@
 
 [section:call_once Non-member function `call_once`]
 
- #include <boost/thread/once.hpp>
-
     template<typename Callable>
     void call_once(once_flag& flag,Callable func);
 

Modified: branches/release/libs/thread/doc/overview.qbk
==============================================================================
--- branches/release/libs/thread/doc/overview.qbk (original)
+++ branches/release/libs/thread/doc/overview.qbk 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,5 +1,6 @@
 [/
- (C) Copyright 2007-8 Anthony Williams.
+ (C) Copyright 2007-12 Anthony Williams.
+ (C) Copyright 20012 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).
@@ -11,7 +12,7 @@
 functions for managing the threads themselves, along with others for synchronizing data between the threads or providing separate
 copies of data specific to individual threads.
 
-The __boost_thread__ library was originally written and designed by William E. Kempf. This version is a major rewrite designed to
+The __boost_thread__ library was originally written and designed by William E. Kempf (version 0). Anthony Williams version (version 1) was a major rewrite designed to
 closely follow the proposals presented to the C++ Standards Committee, in particular
 [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html N2497],
 [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2320.html N2320],
@@ -19,6 +20,9 @@
 [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2139.html N2139], and
 [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2094.html N2094]
 
+Vicente J. Botet Escriba started in version 2 the adaptation to comply with the accepted Thread C++11 library (Make use of Boost.Chrono and Boost.Move) and the [@http://home.roadrunner.com/~hinnant/bloomington/shared_mutex.html Shared Locking] Howard Hinnant proposal except for the upward conversions.
+Some minor features have been added also as thread attributes, reverse_lock, shared_lock_guard.
+
 In order to use the classes and functions described here, you can
 either include the specific headers specified by the descriptions of
 each class or function, or include the master thread library header:
@@ -28,3 +32,20 @@
 which includes all the other headers in turn.
 
 [endsect]
+
+
+[section:build Using and building the library]
+
+Boost.Thread is configured following the conventions used to build [@http://www.boost.org/doc/libs/1_48_0/libs/config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code libraries with separate source code]. Boost.Thread will import/export the code only if the user has specifically asked for it, by defining either BOOST_ALL_DYN_LINK if they want all boost libraries to be dynamically linked, or BOOST_THREAD_DYN_LINK if they want just this one to be dynamically liked.
+
+The definition of these macros determines whether BOOST_THREAD_USE_DLL is defined. If BOOST_THREAD_USE_DLL is not defined, the library will define BOOST_THREAD_USE_DLL or BOOST_THREAD_USE_LIB depending on whether the platform. On non windows platforms BOOST_THREAD_USE_LIB is defined if is not defined. In windows platforms, BOOST_THREAD_USE_LIB is defined if BOOST_THREAD_USE_DLL and the compiler supports auto-tss cleanup with Boost.Threads (for the time been Msvc and Intel)
+
+The source code compiled when building the library defines a macros BOOST_THREAD_SOURCE that is used to import or export it. The user must not define this macro in any case.
+
+The following section describes all the macros used to configure Boost.Thread.
+
+[include configuration.qbk]
+
+
+[endsect]
+

Modified: branches/release/libs/thread/doc/shared_mutex_ref.qbk
==============================================================================
--- branches/release/libs/thread/doc/shared_mutex_ref.qbk (original)
+++ branches/release/libs/thread/doc/shared_mutex_ref.qbk 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -12,19 +12,30 @@
     class shared_mutex
     {
     public:
+ shared_mutex(shared_mutex const&) = delete;
+ shared_mutex& operator=(shared_mutex const&) = delete;
+
         shared_mutex();
         ~shared_mutex();
 
         void lock_shared();
         bool try_lock_shared();
- bool timed_lock_shared(system_time const& timeout);
+ template <class Rep, class Period>
+ bool try_lock_shared_for(const chrono::duration<Rep, Period>& rel_time);
+ template <class Clock, class Duration>
+ bool try_lock_shared_until(const chrono::time_point<Clock, Duration>& abs_time);
         void unlock_shared();
 
         void lock();
         bool try_lock();
- bool timed_lock(system_time const& timeout);
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
         void unlock();
 
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
+ // use upgrade_mutex instead.
         void lock_upgrade();
         void unlock_upgrade();
 
@@ -32,13 +43,101 @@
         void unlock_and_lock_upgrade();
         void unlock_and_lock_shared();
         void unlock_upgrade_and_lock_shared();
+ #endif
+
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 || defined BOOST_THREAD_DONT_USE_CHRONO
+ bool timed_lock_shared(system_time const& timeout);
+ bool timed_lock(system_time const& timeout);
+ #endif
+
     };
 
 The class `boost::shared_mutex` provides an implementation of a multiple-reader / single-writer mutex. It implements the
+__shared_lockable_concept__.
+
+Multiple concurrent calls to __lock_ref__, __try_lock_ref__, `__try_lock_for()`, `__try_lock_until()`, __timed_lock_ref__, __lock_shared_ref__,
+`__try_lock_shared_for()`, `__try_lock_shared_until()`, __try_lock_shared_ref__ and __timed_lock_shared_ref__ are permitted.
+
+
+[endsect]
+
+[section:upgrade_mutex Class `upgrade_mutex`]
+
+ #include <boost/thread/shared_mutex.hpp>
+
+ class upgrade_mutex
+ {
+ public:
+ upgrade_mutex(upgrade_mutex const&) = delete;
+ upgrade_mutex& operator=(upgrade_mutex const&) = delete;
+
+ upgrade_mutex();
+ ~upgrade_mutex();
+
+ void lock_shared();
+ bool try_lock_shared();
+ template <class Rep, class Period>
+ bool try_lock_shared_for(const chrono::duration<Rep, Period>& rel_time);
+ template <class Clock, class Duration>
+ bool try_lock_shared_until(const chrono::time_point<Clock, Duration>& abs_time);
+ void unlock_shared();
+
+ void lock();
+ bool try_lock();
+ template <class Rep, class Period>
+ bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
+ template <class Clock, class Duration>
+ bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
+ void unlock();
+
+ void lock_upgrade();
+ template <class Rep, class Period>
+ bool try_lock_upgrade_for(const chrono::duration<Rep, Period>& rel_time);
+ template <class Clock, class Duration>
+ bool try_lock_upgrade_until(const chrono::time_point<Clock, Duration>& abs_time);
+ void unlock_upgrade();
+
+ // Shared <-> Exclusive
+
+ #ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+ bool try_unlock_shared_and_lock();
+ template <class Rep, class Period>
+ bool try_unlock_shared_and_lock_for(const chrono::duration<Rep, Period>& rel_time);
+ template <class Clock, class Duration>
+ bool try_unlock_shared_and_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
+ #endif
+ void unlock_and_lock_shared();
+
+ // Shared <-> Upgrade
+
+ #ifdef BOOST_THREAD_PROVIDES_SHARED_MUTEX_UPWARDS_CONVERSIONS
+ bool try_unlock_shared_and_lock_upgrade();
+ template <class Rep, class Period>
+ bool try_unlock_shared_and_lock_upgrade_for(const chrono::duration<Rep, Period>& rel_time);
+ template <class Clock, class Duration>
+ bool try_unlock_shared_and_lock_upgrade_until(const chrono::time_point<Clock, Duration>& abs_time);
+ #endif
+ void unlock_upgrade_and_lock_shared();
+
+ // Upgrade <-> Exclusive
+
+ void unlock_upgrade_and_lock();
+ #if defined(BOOST_THREAD_PLATFORM_PTHREAD)
+ || defined(BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN)
+ bool try_unlock_upgrade_and_lock();
+ template <class Rep, class Period>
+ bool try_unlock_upgrade_and_lock_for(const chrono::duration<Rep, Period>& rel_time);
+ template <class Clock, class Duration>
+ bool try_unlock_upgrade_and_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
+ #endif
+ void unlock_and_lock_upgrade();
+ };
+
+The class `boost::upgrade_mutex` provides an implementation of a multiple-reader / single-writer mutex. It implements the
 __upgrade_lockable_concept__.
 
-Multiple concurrent calls to __lock_ref__, __try_lock_ref__, __timed_lock_ref__, __lock_shared_ref__, __try_lock_shared_ref__ and
-__timed_lock_shared_ref__ shall be permitted.
+Multiple concurrent calls to __lock_ref__, __try_lock_ref__, `__try_lock_for()`, `__try_lock_until()`, __timed_lock_ref__, __lock_shared_ref__,
+`__try_lock_shared_for()`, `__try_lock_shared_until()`, __try_lock_shared_ref__ and __timed_lock_shared_ref__ are permitted.
 
 
 [endsect]

Modified: branches/release/libs/thread/doc/thread.qbk
==============================================================================
--- branches/release/libs/thread/doc/thread.qbk (original)
+++ branches/release/libs/thread/doc/thread.qbk 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,14 +1,17 @@
 [/
- (C) Copyright 2007-8 Anthony Williams.
+ (C) Copyright 2008-11 Anthony Williams
+ (C) Copyright 2011-12 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).
 ]
 
-[article Thread
- [quickbook 1.4]
- [authors [Williams, Anthony]]
- [copyright 2007-8 Anthony Williams]
+[library Thread
+ [quickbook 1.5]
+ [version 3.0.0]
+ [authors [Williams, Anthony] [Botet Escriba, Vicente J.]]
+ [copyright 2007-11 Anthony Williams]
+ [copyright 2011-12 Vicente J. Botet Escriba]
     [purpose C++ Library for launching threads and synchronizing data between them]
     [category text]
     [license
@@ -21,6 +24,11 @@
 [template lockable_concept_link[link_text] [link thread.synchronization.mutex_concepts.lockable [link_text]]]
 [def __lockable_concept__ [lockable_concept_link `Lockable` concept]]
 [def __lockable_concept_type__ [lockable_concept_link `Lockable`]]
+[def __BasicLockable [link thread.synchronization.mutex_concepts.basic_lockable `BasicLockable`]]
+[def __Lockable [link thread.synchronization.mutex_concepts.lockable `Lockable`]]
+[def __TimedLockable [link thread.synchronization.mutex_concepts.timed_lockable `TimedLockable `]]
+[def __SharedLockable [link thread.synchronization.mutex_concepts.shared_lockable `SharedLockable `]]
+[def __UpgradeLockable [link thread.synchronization.mutex_concepts.upgrade_lockable `UpgradeLockable `]]
 
 [template timed_lockable_concept_link[link_text] [link thread.synchronization.mutex_concepts.timed_lockable [link_text]]]
 [def __timed_lockable_concept__ [timed_lockable_concept_link `TimedLockable` concept]]
@@ -35,8 +43,9 @@
 [def __upgrade_lockable_concept_type__ [upgrade_lockable_concept_link `UpgradeLockable`]]
 
 
-[template lock_ref_link[link_text] [link thread.synchronization.mutex_concepts.lockable.lock [link_text]]]
+[template lock_ref_link[link_text] [link thread.synchronization.mutex_concepts.basic_lockable.lock [link_text]]]
 [def __lock_ref__ [lock_ref_link `lock()`]]
+[def __lock [link thread.synchronization.mutex_concepts.basic_lockable.lock `lock`]]
 
 [template lock_multiple_ref_link[link_text] [link thread.synchronization.lock_functions.lock_multiple [link_text]]]
 [def __lock_multiple_ref__ [lock_multiple_ref_link `lock()`]]
@@ -44,47 +53,85 @@
 [template try_lock_multiple_ref_link[link_text] [link thread.synchronization.lock_functions.try_lock_multiple [link_text]]]
 [def __try_lock_multiple_ref__ [try_lock_multiple_ref_link `try_lock()`]]
 
-[template unlock_ref_link[link_text] [link thread.synchronization.mutex_concepts.lockable.unlock [link_text]]]
+[template unlock_ref_link[link_text] [link thread.synchronization.mutex_concepts.basic_lockable.unlock [link_text]]]
 [def __unlock_ref__ [unlock_ref_link `unlock()`]]
+[def __unlock [link thread.synchronization.mutex_concepts.basic_lockable.unlock `unlock`]]
 
 [template try_lock_ref_link[link_text] [link thread.synchronization.mutex_concepts.lockable.try_lock [link_text]]]
 [def __try_lock_ref__ [try_lock_ref_link `try_lock()`]]
+[def __try_lock [link thread.synchronization.mutex_concepts.lockable.try_lock `try_lock`]]
 
 [template timed_lock_ref_link[link_text] [link thread.synchronization.mutex_concepts.timed_lockable.timed_lock [link_text]]]
 [def __timed_lock_ref__ [timed_lock_ref_link `timed_lock()`]]
+[def __timed_lock [link thread.synchronization.mutex_concepts.timed_lockable.timed_lock `timed_lock`]]
+
+[def __try_lock_for [link thread.synchronization.mutex_concepts.timed_lockable.try_lock_for `try_lock_for`]]
+[def __try_lock_until [link thread.synchronization.mutex_concepts.timed_lockable.try_lock_until `try_lock_until`]]
 
 [template timed_lock_duration_ref_link[link_text] [link thread.synchronization.mutex_concepts.timed_lockable.timed_lock_duration [link_text]]]
 [def __timed_lock_duration_ref__ [timed_lock_duration_ref_link `timed_lock()`]]
+[def __timed_lock_duration [link thread.synchronization.mutex_concepts.timed_lockable.timed_lock_duration `timed_lock`]]
 
 [template lock_shared_ref_link[link_text] [link thread.synchronization.mutex_concepts.shared_lockable.lock_shared [link_text]]]
 [def __lock_shared_ref__ [lock_shared_ref_link `lock_shared()`]]
+[def __lock_shared [link thread.synchronization.mutex_concepts.shared_lockable.lock_shared `lock_shared()`]]
 
 [template unlock_shared_ref_link[link_text] [link thread.synchronization.mutex_concepts.shared_lockable.unlock_shared [link_text]]]
 [def __unlock_shared_ref__ [unlock_shared_ref_link `unlock_shared()`]]
+[def __unlock_shared [link thread.synchronization.mutex_concepts.shared_lockable.unlock_shared `unlock_shared()`]]
 
 [template try_lock_shared_ref_link[link_text] [link thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared [link_text]]]
 [def __try_lock_shared_ref__ [try_lock_shared_ref_link `try_lock_shared()`]]
+[def __try_lock_shared [link thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared `try_lock_shared`]]
 
 [template timed_lock_shared_ref_link[link_text] [link thread.synchronization.mutex_concepts.shared_lockable.timed_lock_shared [link_text]]]
 [def __timed_lock_shared_ref__ [timed_lock_shared_ref_link `timed_lock_shared()`]]
+[def __try_lock_shared_for [link thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared_for `try_lock_shared_for`]]
+[def __try_lock_shared_for [link thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared_until `try_lock_shared_until`]]
 
 [template timed_lock_shared_duration_ref_link[link_text] [link thread.synchronization.mutex_concepts.shared_lockable.timed_lock_shared_duration [link_text]]]
 [def __timed_lock_shared_duration_ref__ [timed_lock_shared_duration_ref_link `timed_lock_shared()`]]
+[def __try_lock_shared_for [link thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared_for `try_lock_shared_for`]]
+[def __try_lock_shared_until [link thread.synchronization.mutex_concepts.shared_lockable.try_lock_shared_until `try_lock_shared_until`]]
 
 [template lock_upgrade_ref_link[link_text] [link thread.synchronization.mutex_concepts.upgrade_lockable.lock_upgrade [link_text]]]
 [def __lock_upgrade_ref__ [lock_upgrade_ref_link `lock_upgrade()`]]
+[def __lock_upgrade [link thread.synchronization.mutex_concepts.upgrade_lockable.lock_upgrade `lock_upgrade`]]
+[def __try_lock_upgrade [link thread.synchronization.mutex_concepts.upgrade_lockable.try_lock_upgrade `try_lock_upgrade`]]
+[def __try_lock_upgrade_for [link thread.synchronization.mutex_concepts.upgrade_lockable.try_lock_upgrade_for `try_lock_upgrade_for`]]
+[def __try_lock_upgrade_until [link thread.synchronization.mutex_concepts.upgrade_lockable.try_lock_upgrade_until `try_lock_upgrade_until`]]
 
 [template unlock_upgrade_ref_link[link_text] [link thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade [link_text]]]
 [def __unlock_upgrade_ref__ [unlock_upgrade_ref_link `unlock_upgrade()`]]
+[def __unlock_upgrade [link thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade `unlock_upgrade`]]
 
 [template unlock_upgrade_and_lock_ref_link[link_text] [link thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade_and_lock [link_text]]]
 [def __unlock_upgrade_and_lock_ref__ [unlock_upgrade_and_lock_ref_link `unlock_upgrade_and_lock()`]]
+[def __unlock_upgrade_and_lock [link thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade_and_lock `unlock_upgrade_and_lock`]]
 
 [template unlock_and_lock_upgrade_ref_link[link_text] [link thread.synchronization.mutex_concepts.upgrade_lockable.unlock_and_lock_upgrade [link_text]]]
 [def __unlock_and_lock_upgrade_ref__ [unlock_and_lock_upgrade_ref_link `unlock_and_lock_upgrade()`]]
+[def __unlock_and_lock_upgrade [link thread.synchronization.mutex_concepts.upgrade_lockable.unlock_and_lock_upgrade `unlock_and_lock_upgrade`]]
 
 [template unlock_upgrade_and_lock_shared_ref_link[link_text] [link thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade_and_lock_shared [link_text]]]
 [def __unlock_upgrade_and_lock_shared_ref__ [unlock_upgrade_and_lock_shared_ref_link `unlock_upgrade_and_lock_shared()`]]
+[def __unlock_upgrade_and_lock_shared [link thread.synchronization.mutex_concepts.upgrade_lockable.unlock_upgrade_and_lock_shared `unlock_upgrade_and_lock_shared`]]
+
+
+[def __try_unlock_shared_and_lock [link thread.synchronization.mutex_concepts.upgrade_lockable.try_unlock_shared_and_lock `try_unlock_shared_and_lock`]]
+[def __try_unlock_shared_and_lock_for [link thread.synchronization.mutex_concepts.upgrade_lockable.try_unlock_shared_and_lock_for `try_unlock_shared_and_lock_for`]]
+[def __try_unlock_shared_and_lock_until [link thread.synchronization.mutex_concepts.upgrade_lockable.try_unlock_shared_and_lock_until `try_unlock_shared_and_lock_until`]]
+
+[def __unlock_and_lock_shared [link thread.synchronization.mutex_concepts.upgrade_lockable.unlock_and_lock_shared `unlock_and_lock_shared`]]
+
+[def __try_unlock_shared_and_lock_upgrade [link thread.synchronization.mutex_concepts.upgrade_lockable.try_unlock_shared_and_lock_upgrade `try_unlock_shared_and_lock_upgrade`]]
+[def __try_unlock_shared_and_lock_upgrade_for [link thread.synchronization.mutex_concepts.upgrade_lockable.try_unlock_shared_and_lock_upgrade_for `try_unlock_shared_and_lock_upgrade_for`]]
+[def __try_unlock_shared_and_lock_upgrade_until [link thread.synchronization.mutex_concepts.upgrade_lockable.try_unlock_shared_and_lock_upgrade_until `try_unlock_shared_and_lock_upgrade_until`]]
+
+[def __try_unlock_upgrade_and_lock [link thread.synchronization.mutex_concepts.upgrade_lockable.try_unlock_upgrade_and_lock `try_unlock_upgrade_and_lock`]]
+[def __try_unlock_upgrade_and_lock_for [link thread.synchronization.mutex_concepts.upgrade_lockable.try_unlock_upgrade_and_lock_for `try_unlock_upgrade_and_lock_for`]]
+[def __try_unlock_upgrade_and_lock_until [link thread.synchronization.mutex_concepts.upgrade_lockable.try_unlock_upgrade_and_lock_until `try_unlock_upgrade_and_lock_until`]]
+
 
 [template owns_lock_ref_link[link_text] [link thread.synchronization.locks.unique_lock.owns_lock [link_text]]]
 [def __owns_lock_ref__ [owns_lock_ref_link `owns_lock()`]]
@@ -114,17 +161,29 @@
 [def __shared_lock__ [link thread.synchronization.locks.shared_lock `boost::shared_lock`]]
 [def __upgrade_lock__ [link thread.synchronization.locks.upgrade_lock `boost::upgrade_lock`]]
 [def __upgrade_to_unique_lock__ [link thread.synchronization.locks.upgrade_to_unique_lock `boost::upgrade_to_unique_lock`]]
+[def __reverse_lock [link thread.synchronization.other_locks.reverse_lock `reverse_lock`]]
+[def __shared_lock_guard [link thread.synchronization.other_locks.shared_lock_guard `shared_lock_guard`]]
 
 
 [def __thread__ [link thread.thread_management.thread `boost::thread`]]
+[def __thread [link thread.thread_management.thread `boost::thread`]]
 [def __thread_id__ [link thread.thread_management.thread.id `boost::thread::id`]]
 [template join_link[link_text] [link thread.thread_management.thread.join [link_text]]]
 [def __join__ [join_link `join()`]]
+
+[def __try_join_for [link thread.thread_management.thread.try_join_for `try_join_for`]]
+[def __try_join_until [link thread.thread_management.thread.try_join_until `try_join_until`]]
+
+
 [template timed_join_link[link_text] [link thread.thread_management.thread.timed_join [link_text]]]
 [def __timed_join__ [timed_join_link `timed_join()`]]
 [def __detach__ [link thread.thread_management.thread.detach `detach()`]]
 [def __interrupt__ [link thread.thread_management.thread.interrupt `interrupt()`]]
 [def __sleep__ [link thread.thread_management.this_thread.sleep `boost::this_thread::sleep()`]]
+[def __sleep_for [link thread.thread_management.this_thread.sleep_for `sleep_for`]]
+[def __sleep_until [link thread.thread_management.this_thread.sleep_until `sleep_until`]]
+[def __yield [link thread.thread_management.this_thread.yield `yield`]]
+[def __get_id [link thread.thread_management.thread.get_id `get_id`]]
 
 [def __interruption_enabled__ [link thread.thread_management.this_thread.interruption_enabled `boost::this_thread::interruption_enabled()`]]
 [def __interruption_requested__ [link thread.thread_management.this_thread.interruption_requested `boost::this_thread::interruption_requested()`]]
@@ -140,11 +199,21 @@
 [def __cond_wait__ [cond_wait_link `wait()`]]
 [template cond_timed_wait_link[link_text] [link thread.synchronization.condvar_ref.condition_variable.timed_wait [link_text]]]
 [def __cond_timed_wait__ [cond_timed_wait_link `timed_wait()`]]
+
+[def __condition_variable [link thread.synchronization.condvar_ref.condition_variable `condition_variable`]]
+[def __wait_for [link thread.synchronization.condvar_ref.condition_variable.wait_for `wait_for`]]
+[def __wait_until [link thread.synchronization.condvar_ref.condition_variable.wait_until `wait_until`]]
+
+
 [template cond_any_wait_link[link_text] [link thread.synchronization.condvar_ref.condition_variable_any.wait [link_text]]]
 [def __cond_any_wait__ [cond_any_wait_link `wait()`]]
 [template cond_any_timed_wait_link[link_text] [link thread.synchronization.condvar_ref.condition_variable_any.timed_wait [link_text]]]
 [def __cond_any_timed_wait__ [cond_any_timed_wait_link `timed_wait()`]]
 
+[def __condition_variable_any [link thread.synchronization.condvar_ref.condition_variable_any `condition_variable_any`]]
+[def __cvany_wait_for [link thread.synchronization.condvar_ref.condition_variable_any.wait_for `wait_for`]]
+[def __cvany_wait_until [link thread.synchronization.condvar_ref.condition_variable_any.wait_until `wait_until`]]
+
 [def __blocked__ ['blocked]]
 
 [include overview.qbk]
@@ -153,6 +222,7 @@
 [include thread_ref.qbk]
 
 [section:synchronization Synchronization]
+[include sync_tutorial.qbk]
 [include mutex_concepts.qbk]
 [include mutexes.qbk]
 [include condition_variables.qbk]
@@ -165,6 +235,8 @@
 
 [include time.qbk]
 
+[include emulations.qbk]
+
 [include acknowledgements.qbk]
 
 [include compliance.qbk]

Modified: branches/release/libs/thread/doc/thread_ref.qbk
==============================================================================
--- branches/release/libs/thread/doc/thread_ref.qbk (original)
+++ branches/release/libs/thread/doc/thread_ref.qbk 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,5 +1,6 @@
 [/
   (C) Copyright 2007-8 Anthony Williams.
+ (C) Copyright 2011-12 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).
@@ -7,7 +8,46 @@
 
 [section:thread_management Thread Management]
 
-[heading Synopsis]
+[section:synopsis Synopsis]
+
+ #include <boost/thread/thread.hpp>
+
+ namespace boost
+ {
+ class thread;
+ void swap(thread& lhs,thread& rhs) noexcept;
+
+ namespace this_thread
+ {
+ thread::id get_id() noexcept;
+ template<typename TimeDuration>
+ void yield() noexcept;
+ template <class Clock, class Duration>
+ void sleep_until(const chrono::time_point<Clock, Duration>& abs_time);
+ template <class Rep, class Period>
+ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
+
+ template<typename Callable>
+ void at_thread_exit(Callable func); // EXTENSION
+
+ void interruption_point(); // EXTENSION
+ bool interruption_requested() noexcept; // EXTENSION
+ bool interruption_enabled() noexcept; // EXTENSION
+ class disable_interruption; // EXTENSION
+ class restore_interruption; // EXTENSION
+
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
+ void sleep(TimeDuration const& rel_time);
+ void sleep(system_time const& abs_time);
+ #endif
+ }
+ class thread_group; // EXTENSION
+
+ }
+
+[endsect] [/section:synopsis Synopsis]
+
+[section:tutorial Tutorial]
 
 The __thread__ class is responsible for launching and managing threads. Each __thread__ object represents a single thread of execution,
 or __not_a_thread__, and at most one __thread__ object represents a given thread of execution: objects of type __thread__ are not
@@ -24,14 +64,14 @@
         some_thread.join();
     }
 
-[Note: On compilers that support rvalue references, __thread__ provides a proper move constructor and move-assignment operator, and
+[note On compilers that support rvalue references, __thread__ provides a proper move constructor and move-assignment operator, and
 therefore meets the C++0x ['MoveConstructible] and ['MoveAssignable] concepts. With such compilers, __thread__ can therefore be used
 with containers that support those concepts.
 
 For other compilers, move support is provided with a move emulation layer, so containers must explicitly detect that move emulation
 layer. See <boost/thread/detail/move.hpp> for details.]
 
-[heading Launching threads]
+[section:launching Launching threads]
 
 A new thread is launched by passing an object of a callable type that can be invoked with no parameters to the constructor. The
 object is then copied into internal storage, and invoked on the newly-created thread of execution. If the object must not (or
@@ -68,12 +108,99 @@
 
 There is an unspecified limit on the number of additional arguments that can be passed.
 
-[heading Exceptions in thread functions]
+[endsect]
+
+[section:attributes Thread attributes]
+
+Thread launched in this way are created with implementation defined thread attributes as stack size, scheduling,
+priority, ... or any platform specific attributes. It is not evident how to provide a portable interface that allows
+the user to set the platform specific attributes. Boost.Thread stay in the middle road through the class
+thread::attributes which allows to set at least in a portable way the stack size as follows:
+
+ boost::thread::attributes attrs;
+ attrs.set_size(4096*10);
+ boost::thread deep_thought_2(attrs, find_the_question, 42);
+
+Even for this simple attribute there could be portable issues as some platforms could require that the stack size
+should have a minimal size and/or be a multiple of a given page size.
+The library adapts the requested size to the platform constraints so that the user doesn't need to take care of it.
+
+This is the single attribute that is provided in a portable way. In order to set any other thread attribute at
+construction time the user needs to use non portable code.
+
+On PThread platforms the user will need to get the thread attributes handle and use it for whatever attribute.
+
+Next follows how the user could set the stack size and the scheduling policy on PThread platforms.
+
+ boost::thread::attributes attrs;
+ // set portable attributes
+ // ...
+ attr.set_stack_size(4096*10);
+ #if defined(BOOST_THREAD_PLATFORM_WIN32)
+ // ... window version
+ #elif defined(BOOST_THREAD_PLATFORM_PTHREAD)
+ // ... pthread version
+ pthread_attr_setschedpolicy(attr.get_native_handle(), SCHED_RR);
+ #else
+ #error "Boost threads unavailable on this platform"
+ #endif
+ boost::thread th(attrs, find_the_question, 42);
+
+On Windows platforms it is not so simple as there is no type that compiles the thread attributes.
+There is a linked to the creation of a thread on Windows that is emulated via the thread::attributes class. This is the LPSECURITY_ATTRIBUTES lpThreadAttributes.
+Boost.Thread provides a non portable set_security function so that the user can provide it before the thread creation as follows
+
+[/Boost.Thread creates Windows threads that are suspended. Then it calls to the virtual function set_attributes and last it resumes the thread.
+The user needs to define a class that inherits from the class thread::attributes that defines a virtual function set_attributes to set any specific Windows thread attribute.
+
+
+ class MyWinTthreadAttributes : boost::thread::attributes
+ {
+ public:
+ void set_attributes(boost::thread::native_handle_type h)
+ {
+ // use any specific windows thread setting
+
+ }
+ };
+ #if defined(BOOST_THREAD_PLATFORM_WIN32)
+
+ MyWinTthreadAttributes attrs;
+ // set portable attributes
+ // ...
+ attr.set_stack_size(4096*10);
+ boost::thread th(attrs, find_the_question, 42);
+ #else
+ #error "Platform not supported"
+ #endif
+
+]
+
+ #if defined(BOOST_THREAD_PLATFORM_WIN32)
+ boost::thread::attributes attrs;
+ // set portable attributes
+ attr.set_stack_size(4096*10);
+ // set non portable attribute
+ LPSECURITY_ATTRIBUTES sec;
+ // init sec
+ attr.set_security(sec);
+ boost::thread th(attrs, find_the_question, 42);
+ // Set other thread attributes using the native_handle_type.
+ //...
+ #else
+ #error "Platform not supported"
+ #endif
+
+[endsect]
+
+[section:exceptions Exceptions in thread functions]
 
 If the function or callable object passed to the __thread__ constructor propagates an exception when invoked that is not of type
 __thread_interrupted__, `std::terminate()` is called.
 
-[heading Joining and detaching]
+[endsect]
+
+[section:join Joining and detaching]
 
 When the __thread__ object that represents a thread of execution is destroyed the thread becomes ['detached]. Once a thread is
 detached, it will continue executing until the invocation of the function or callable object supplied on construction has completed,
@@ -86,7 +213,9 @@
 returns immediately. __timed_join__ is similar, except that a call to __timed_join__ will also return if the thread being waited for
 does not complete when the specified time has elapsed.
 
-[heading Interruption]
+[endsect]
+
+[section:interruption Interruption]
 
 A running thread can be ['interrupted] by invoking the __interrupt__ member function of the corresponding __thread__ object. When the
 interrupted thread next executes one of the specified __interruption_points__ (or if it is currently __blocked__ whilst executing one)
@@ -143,15 +272,24 @@
 
 * [join_link `boost::thread::join()`]
 * [timed_join_link `boost::thread::timed_join()`]
+* `boost::__thread::__try_join_for()`,
+* `boost::__thread::__try_join_until()`,
 * [cond_wait_link `boost::condition_variable::wait()`]
 * [cond_timed_wait_link `boost::condition_variable::timed_wait()`]
+* `boost::__condition_variable::__wait_for()`
+* `boost::__condition_variable::__wait_until()`
 * [cond_any_wait_link `boost::condition_variable_any::wait()`]
 * [cond_any_timed_wait_link `boost::condition_variable_any::timed_wait()`]
+* `boost::__condition_variable_any::__cvany_wait_for()`
+* `boost::__condition_variable_any::__cvany_wait_until()`
 * [link thread.thread_management.thread.sleep `boost::thread::sleep()`]
-* __sleep__
+* `boost::this_thread::__sleep_for()`
+* `boost::this_thread::__sleep_until()`
 * __interruption_point__
 
-[heading Thread IDs]
+[endsect]
+
+[section:id Thread IDs]
 
 Objects of class __thread_id__ can be used to identify threads. Each running thread of execution has a unique ID obtainable
 from the corresponding __thread__ by calling the `get_id()` member function, or by calling `boost::this_thread::get_id()` from
@@ -163,14 +301,15 @@
 compare equal to each other, but not equal to any instances that refer to an actual thread of execution. The comparison operators on
 __thread_id__ yield a total order for every non-equal thread ID.
 
-[heading Using native interfaces with Boost.Thread resources]
+[endsect]
+
+[section:native_in Using native interfaces with Boost.Thread resources]
 
 
 __thread__ class has members `native_handle_type` and `native_handle` providing access to the underlying native handle.
          
 This native handle can be used to change for example the scheduling.
 
-
 In general, it is not safe to use this handle with operations that can conflict with the ones provided by Boost.Thread. An example of bad usage could be detaching a thread directly as it will not change the internals of the __thread__ instance, so for example the joinable function will continue to return true, while the native thread is no more joinable.
 
   thread t(fct);
@@ -178,19 +317,21 @@
   pthread_detach(hnd);
   assert(t.joinable());
 
-[heading Using Boost.Thread interfaces in a native thread]
+[endsect]
+
+[section:native_from Using Boost.Thread interfaces in a native thread]
  
 
 Any thread of execution created using the native interface is called a native thread in this documentation.
 
 The first example of a native thread of execution is the main thread.
 
-The user can access to some synchronization functions related to the native current thread using the `boost::this_thread` `yield`, `sleep`, functions.
+The user can access to some synchronization functions related to the native current thread using the `boost::this_thread` `yield`, `sleep`, __sleep_for, __sleep_until, functions.
 
 
   int main() {
     // ...
- boost::this_thread::sleep();
+ boost::this_thread::sleep_for(boost::chrono::milliseconds(10));
     // ...
   }
 
@@ -201,6 +342,16 @@
 
 As the single way to interrupt a thread is through a __thread__ instance, `interruption_request()` wiil returns false for the native threads.
 
+[heading `pthread_exit` POSIX limitation]
+
+`pthread_exit` in glibc/NPTL causes a "forced unwind" that is almost like a C++ exception, but not quite. On Mac OS X, for example, `pthread_exit` unwinds without calling C++ destructors.
+
+This behavior is incompatible with the current Boost.Thread design, so the use of this function in a POSIX thread result in undefined behavior of any Boost.Thread function.
+
+[endsect]
+
+[endsect] [/section:tutorial Tutorial]
+
 [section:thread Class `thread`]
 
     #include <boost/thread/thread.hpp>
@@ -208,65 +359,88 @@
     class thread
     {
     public:
- thread();
+ thread() noexcept;
+ thread(const thread&) = delete;
+ thread& operator=(const thread&) = delete;
+
+ thread(thread&&) noexcept;
+ thread& operator=(thread&&) noexcept;
         ~thread();
 
         template <class F>
         explicit thread(F f);
+ template <class F>
+ thread(F &&f);
 
         template <class F,class A1,class A2,...>
         thread(F f,A1 a1,A2 a2,...);
+ // template <class F, class ...Args>
+ // explicit thread(F&& f, Args&&... args); // NOT YET IMPLEMENTED
 
         template <class F>
- thread(detail::thread_move_t<F> f);
+ explicit thread(attributes& attrs, F f); // EXTENSION
+ template <class F>
+ thread(attributes& attrs, F &&f); // EXTENSION
+ // template <class F, class ...Args>
+ // explicit thread(attributes& attrs, F&& f, Args&&... args); // NOT YET IMPLEMENTED
 
         // move support
- thread(detail::thread_move_t<thread> x);
- thread& operator=(detail::thread_move_t<thread> x);
- operator detail::thread_move_t<thread>();
- detail::thread_move_t<thread> move();
+ thread(thread && x) noexcept;
+ thread& operator=(thread && x) noexcept;
 
- void swap(thread& x);
+ void swap(thread& x) noexcept;
 
         class id;
- id get_id() const;
+ class attributes;
 
- bool joinable() const;
- void join();
- bool timed_join(const system_time& wait_until);
+ id get_id() const noexcept;
 
- template<typename TimeDuration>
- bool timed_join(TimeDuration const& rel_time);
+ bool joinable() const noexcept;
+ void join();
+ template <class Rep, class Period>
+ bool try_join_for(const chrono::duration<Rep, Period>& rel_time); // EXTENSION
+ template <class Clock, class Duration>
+ bool try_join_until(const chrono::time_point<Clock, Duration>& t); // EXTENSION
 
         void detach();
 
- static unsigned hardware_concurrency();
+ static unsigned hardware_concurrency() noexcept;
 
         typedef platform-specific-type native_handle_type;
         native_handle_type native_handle();
 
- void interrupt();
- bool interruption_requested() const;
+ void interrupt(); // EXTENSION
+ bool interruption_requested() const noexcept; // EXTENSION
+
 
- // backwards compatibility
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 || defined BOOST_THREAD_DONT_USE_CHRONO
+ bool timed_join(const system_time& wait_until);
+ template<typename TimeDuration>
+ bool timed_join(TimeDuration const& rel_time);
+ #endif
+
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0
         bool operator==(const thread& other) const;
         bool operator!=(const thread& other) const;
 
         static void yield();
         static void sleep(const system_time& xt);
+ #endif
+
     };
 
- void swap(thread& lhs,thread& rhs);
- detail::thread_move_t<thread> move(detail::thread_move_t<thread> t);
+ void swap(thread& lhs,thread& rhs) noexcept;
 
 [section:default_constructor Default Constructor]
 
- thread();
+ thread() noexcept;
 
 [variablelist
 
 [[Effects:] [Constructs a __thread__ instance that refers to __not_a_thread__.]]
 
+[[Postconditions:] [`this->get_id()==thread::id()`]]
+
 [[Throws:] [Nothing]]
 
 ]
@@ -275,13 +449,13 @@
 
 [section:move_constructor Move Constructor]
 
- thread(detail::thread_move_t<thread> other);
+ thread(thread&& other) noexcept;
 
 [variablelist
 
 [[Effects:] [Transfers ownership of the thread managed by `other` (if any) to the newly constructed __thread__ instance.]]
 
-[[Postconditions:] [`other->get_id()==thread::id()`]]
+[[Postconditions:] [`other.get_id()==thread::id()` and `get_id()` returns the value of `other.get_id()` prior to the construction]]
 
 [[Throws:] [Nothing]]
 
@@ -291,15 +465,15 @@
 
 [section:move_assignment Move assignment operator]
 
- thread& operator=(detail::thread_move_t<thread> other);
+ thread& operator=(thread&& other) noexcept;
 
 [variablelist
 
 [[Effects:] [Transfers ownership of the thread managed by `other` (if
-any) to `*this`. If there was a thread previously associated with
-`*this` then that thread is detached.]]
+any) to `*this`. Version 1: If there was a thread previously associated with
+`*this` then that thread is detached, version 2: If the thread is joinable calls to std::terminate.]]
 
-[[Postconditions:] [`other->get_id()==thread::id()`]]
+[[Postconditions:] [`other->get_id()==thread::id()` and `get_id()` returns the value of `other.get_id()` prior to the assignment.]]
 
 [[Throws:] [Nothing]]
 
@@ -314,20 +488,110 @@
 
 [variablelist
 
+[[Requires:] [`Callable` must by Copyable and `func()` must be a valid expression.]]
+
+[[Effects:] [`func` is copied into storage managed internally by the thread library, and that copy is invoked on a newly-created
+thread of execution. If this invocation results in an exception being propagated into the internals of the thread library that is
+not of type __thread_interrupted__, then `std::terminate()` will be called. Any return value from this invocation is ignored.]]
+
+[[Postconditions:] [`*this` refers to the newly created thread of execution and `this->get_id()!=thread::id()`.]]
+
+[[Throws:] [__thread_resource_error__ if an error occurs. ]]
+
+[[Error Conditions:] [
+
+[*resource_unavailable_try_again] : the system lacked the necessary resources to create an- other thread, or the system-imposed limit on the number of threads in a process would be exceeded.
+
+]]
+
+]
+
+[endsect]
+
+[section:attr_callable_constructor Thread Attributes Constructor EXTENSION]
+
+ template<typename Callable>
+ thread(attributes& attrs, Callable func);
+
+[variablelist
+
 [[Preconditions:] [`Callable` must by copyable.]]
 
 [[Effects:] [`func` is copied into storage managed internally by the thread library, and that copy is invoked on a newly-created
+thread of execution with the specified attributes. If this invocation results in an exception being propagated into the internals of the thread library that is
+not of type __thread_interrupted__, then `std::terminate()` will be called. Any return value from this invocation is ignored.
+If the attributes declare the native thread as detached, the boost::thread will be detached.]]
+
+[[Postconditions:] [`*this` refers to the newly created thread of execution and `this->get_id()!=thread::id()`.]]
+
+[[Throws:] [__thread_resource_error__ if an error occurs. ]]
+
+[[Error Conditions:] [
+
+[*resource_unavailable_try_again] : the system lacked the necessary resources to create an- other thread, or the system-imposed limit on the number of threads in a process would be exceeded.
+
+]]
+
+]
+
+[endsect]
+
+[section:callable_move_constructor Thread Callable Move Constructor]
+
+ template<typename Callable>
+ thread(Callable &&func);
+
+[variablelist
+
+[[Preconditions:] [`Callable` must by Movable.]]
+
+[[Effects:] [`func` is moved into storage managed internally by the thread library, and that copy is invoked on a newly-created
 thread of execution. If this invocation results in an exception being propagated into the internals of the thread library that is
-not of type __thread_interrupted__, then `std::terminate()` will be called.]]
+not of type __thread_interrupted__, then `std::terminate()` will be called. Any return value from this invocation is ignored.]]
 
-[[Postconditions:] [`*this` refers to the newly created thread of execution.]]
+[[Postconditions:] [`*this` refers to the newly created thread of execution and `this->get_id()!=thread::id()`.]]
 
-[[Throws:] [__thread_resource_error__ if an error occurs.]]
+[[Throws:] [__thread_resource_error__ if an error occurs. ]]
+
+[[Error Conditions:] [
+
+[*resource_unavailable_try_again] : the system lacked the necessary resources to create an- other thread, or the system-imposed limit on the number of threads in a process would be exceeded.
+
+]]
 
 ]
 
 [endsect]
 
+[section:attr_callable_move_constructor Thread Attributes Move Constructor EXTENSION]
+
+ template<typename Callable>
+ thread(attributes& attrs, Callable func);
+
+[variablelist
+
+[[Preconditions:] [`Callable` must by copyable.]]
+
+[[Effects:] [`func` is copied into storage managed internally by the thread library, and that copy is invoked on a newly-created
+thread of execution with the specified attributes. If this invocation results in an exception being propagated into the internals of the thread library that is
+not of type __thread_interrupted__, then `std::terminate()` will be called. Any return value from this invocation is ignored.
+If the attributes declare the native thread as detached, the boost::thread will be detached.]]
+
+[[Postconditions:] [`*this` refers to the newly created thread of execution and `this->get_id()!=thread::id()`.]]
+
+[[Throws:] [__thread_resource_error__ if an error occurs. ]]
+
+[[Error Conditions:] [
+
+[*resource_unavailable_try_again] : the system lacked the necessary resources to create an- other thread, or the system-imposed limit on the number of threads in a process would be exceeded.
+
+]]
+
+]
+
+[endsect]
+
+
 [section:multiple_argument_constructor Thread Constructor with arguments]
 
     template <class F,class A1,class A2,...>
@@ -346,6 +610,12 @@
 
 [[Throws:] [__thread_resource_error__ if an error occurs.]]
 
+[[Error Conditions:] [
+
+[*resource_unavailable_try_again] : the system lacked the necessary resources to create an- other thread, or the system-imposed limit on the number of threads in a process would be exceeded.
+
+]]
+
 [[Note:] [Currently up to nine additional arguments `a1` to `a9` can be specified in addition to the function `f`.]]
 
 ]
@@ -358,7 +628,7 @@
 
 [variablelist
 
-[[Effects:] [If `*this` has an associated thread of execution, calls __detach__. Destroys `*this`.]]
+[[Effects:] [Version 1: If `*this` has an associated thread of execution, calls __detach__, Version 2: If the thread is joinable calls to std::terminate. Destroys `*this`.]]
 
 [[Throws:] [Nothing.]]
 
@@ -366,9 +636,28 @@
 
 [endsect]
 
+[/
+[section:v2_destructor V3 Thread Destructor]
+
+ ~thread();
+
+[variablelist
+
+[[Effects:] [If `*this` has an associated thread of execution, calls terminate. Destroys `*this`.]]
+
+[[Note:] [Either implicitly detaching or joining a `joinable()` thread in its destructor could result in difficult to debug correctness (for `detach`) or performance (for `join`) bugs encountered only when an exception is raised. Thus the programmer must ensure that the destructor is never executed while the thread is still joinable.]]
+
+
+[[Throws:] [Nothing.]]
+
+]
+
+[endsect]
+]
+
 [section:joinable Member function `joinable()`]
 
- bool joinable() const;
+ bool joinable() const noexcept;
 
 [variablelist
 
@@ -387,13 +676,25 @@
 
 [variablelist
 
-[[Preconditions:] [`this->get_id()!=boost::this_thread::get_id()`]]
+[[Preconditions:] [the thread is joinable.]]
 
 [[Effects:] [If `*this` refers to a thread of execution, waits for that thread of execution to complete.]]
 
 [[Postconditions:] [If `*this` refers to a thread of execution on entry, that thread of execution has completed. `*this` no longer refers to any thread of execution.]]
 
-[[Throws:] [__thread_interrupted__ if the current thread of execution is interrupted.]]
+[[Throws:] [__thread_interrupted__ if the current thread of execution is interrupted or `system_error`]]
+
+[[Error Conditions:] [
+
+[*resource_deadlock_would_occur]: if deadlock is detected or this->get_id() == std::this_thread::get_id().
+
+[/
+[*no_such_process]: if the thread is not valid.
+
+[*invalid_argument]: if the thread is not joinable.
+]
+
+]]
 
 [[Notes:] [`join()` is one of the predefined __interruption_points__.]]
 
@@ -422,7 +723,19 @@
 has completed, and `*this` no longer refers to any thread of execution. If this call to `timed_join` returns `false`, `*this` is
 unchanged.]]
 
-[[Throws:] [__thread_interrupted__ if the current thread of execution is interrupted.]]
+[[Throws:] [__thread_interrupted__ if the current thread of execution is interrupted or `system_error`]]
+
+[[Error Conditions:] [
+
+[*resource_deadlock_would_occur]: if deadlock is detected or this->get_id() == std::this_thread::get_id().
+
+[/
+[*no_such_process]: if the thread is not valid.
+
+[*invalid_argument]: if the thread is not joinable.
+]
+
+]]
 
 [[Notes:] [`timed_join()` is one of the predefined __interruption_points__.]]
 
@@ -430,13 +743,95 @@
 
 [endsect]
 
+[section:try_join_for Member function `try_join_for()` EXTENSION]
+
+ template <class Rep, class Period>
+ bool try_join_for(const chrono::duration<Rep, Period>& rel_time);
+
+[variablelist
+
+[[Preconditions:] [`this->get_id()!=boost::this_thread::get_id()`]]
+
+[[Effects:] [If `*this` refers to a thread of execution, waits for that thread of execution to complete,
+the specified duration `rel_time` has elapsed. If `*this` doesn't refer to a thread of execution, returns immediately.]]
+
+[[Returns:] [`true` if `*this` refers to a thread of execution on entry, and that thread of execution has completed before the call
+times out, `false` otherwise.]]
+
+[[Postconditions:] [If `*this` refers to a thread of execution on entry, and `try_join_for` returns `true`, that thread of execution
+has completed, and `*this` no longer refers to any thread of execution. If this call to `try_join_for` returns `false`, `*this` is
+unchanged.]]
+
+[[Throws:] [__thread_interrupted__ if the current thread of execution is interrupted or `system_error`]]
+
+[[Error Conditions:] [
+
+[*resource_deadlock_would_occur]: if deadlock is detected or this->get_id() == std::this_thread::get_id().
+
+[/
+[*no_such_process]: if the thread is not valid.
+
+[*invalid_argument]: if the thread is not joinable.
+]
+
+]]
+
+[[Notes:] [`try_join_for()` is one of the predefined __interruption_points__.]]
+
+]
+
+[endsect]
+
+[section:try_join_until Member function `try_join_until()` EXTENSION]
+
+ template <class Clock, class Duration>
+ bool try_join_until(const chrono::time_point<Clock, Duration>& abs_time);
+
+[variablelist
+
+[[Preconditions:] [`this->get_id()!=boost::this_thread::get_id()`]]
+
+[[Effects:] [If `*this` refers to a thread of execution, waits for that thread of execution to complete, the time `abs_time` has
+been reach. If `*this` doesn't refer to a thread of execution, returns immediately.]]
+
+[[Returns:] [`true` if `*this` refers to a thread of execution on entry, and that thread of execution has completed before the call
+times out, `false` otherwise.]]
+
+[[Postconditions:] [If `*this` refers to a thread of execution on entry, and `try_join_until` returns `true`, that thread of execution
+has completed, and `*this` no longer refers to any thread of execution. If this call to `try_join_until` returns `false`, `*this` is
+unchanged.]]
+
+[[Throws:] [__thread_interrupted__ if the current thread of execution is interrupted or `system_error`]]
+
+[[Error Conditions:] [
+
+[*resource_deadlock_would_occur]: if deadlock is detected or this->get_id() == std::this_thread::get_id().
+
+[/
+[*no_such_process]: if the thread is not valid.
+
+[*invalid_argument]: if the thread is not joinable.
+]
+
+]]
+
+[[Notes:] [`try_join_until()` is one of the predefined __interruption_points__.]]
+
+]
+
+[endsect]
+
+
+
 [section:detach Member function `detach()`]
 
- void detach();
+ void detach() noexcept;
 
 [variablelist
 
-[[Effects:] [If `*this` refers to a thread of execution, that thread of execution becomes detached, and no longer has an associated __thread__ object.]]
+[[Preconditions:] [the thread is joinable.]]
+
+[[Effects:] [The thread of execution becomes detached, and no longer has an associated __thread__ object.]]
 
 [[Postconditions:] [`*this` no longer refers to any thread of execution.]]
 
@@ -449,7 +844,7 @@
 
 [section:get_id Member function `get_id()`]
 
- thread::id get_id() const;
+ thread::id get_id() const noexcept;
 
 [variablelist
 
@@ -481,7 +876,7 @@
 
 [section:hardware_concurrency Static member function `hardware_concurrency()`]
 
- unsigned hardware_concurrency();
+ unsigned hardware_concurrency() noexecpt;
 
 [variablelist
 
@@ -510,7 +905,7 @@
 
 [endsect]
 
-[section:equals `operator==`]
+[section:equals `operator==` DEPRECATED V3]
 
     bool operator==(const thread& other) const;
 
@@ -518,11 +913,13 @@
 
 [[Returns:] [`get_id()==other.get_id()`]]
 
+[[See:] [Use `a.__get_id()==b.__get_id()` instead]]
+
 ]
 
 [endsect]
 
-[section:not_equals `operator!=`]
+[section:not_equals `operator!=` DEPRECATED V3]
 
     bool operator!=(const thread& other) const;
 
@@ -530,6 +927,8 @@
 
 [[Returns:] [`get_id()!=other.get_id()`]]
 
+[[See:] [Use `a.__get_id()!=b.__get_id()` instead`]]
+
 ]
 
 [endsect]
@@ -546,6 +945,8 @@
 
 [[Notes:] [`sleep()` is one of the predefined __interruption_points__.]]
 
+[[See:] [Use `this_thread::__sleep_for()` or `this_thread::__sleep_until()`]]
+
 ]
 
 [endsect]
@@ -558,13 +959,15 @@
 
 [[Effects:] [See [link thread.thread_management.this_thread.yield `boost::this_thread::yield()`].]]
 
+[[See:] [Use `this_thread::__yield()`]]
+
 ]
 
 [endsect]
 
 [section:swap Member function `swap()`]
 
- void swap(thread& other);
+ void swap(thread& other) noexcept;
 
 [variablelist
 
@@ -584,7 +987,7 @@
 
     #include <boost/thread/thread.hpp>
 
- void swap(thread& lhs,thread& rhs);
+ void swap(thread& lhs,thread& rhs) noexcept;
 
 [variablelist
 
@@ -594,26 +997,6 @@
 
 [endsect]
 
-[section:non_member_move Non-member function `move()`]
-
- #include <boost/thread/thread.hpp>
-
- detail::thread_move_t<thread> move(detail::thread_move_t<thread> t)
-
-[variablelist
-
-[[Returns:] [`t`.]]
-
-]
-
-Enables moving thread objects. e.g.
-
- extern void some_func();
- boost::thread t(some_func);
- boost::thread t2(boost::move(t)); // transfer thread from t to t2
-
-[endsect]
-
 
 [section:id Class `boost::thread::id`]
 
@@ -622,14 +1005,14 @@
     class thread::id
     {
     public:
- id();
+ id() noexcept;
 
- bool operator==(const id& y) const;
- bool operator!=(const id& y) const;
- bool operator<(const id& y) const;
- bool operator>(const id& y) const;
- bool operator<=(const id& y) const;
- bool operator>=(const id& y) const;
+ bool operator==(const id& y) const noexcept;
+ bool operator!=(const id& y) const noexcept;
+ bool operator<(const id& y) const noexcept;
+ bool operator>(const id& y) const noexcept;
+ bool operator<=(const id& y) const noexcept;
+ bool operator>=(const id& y) const noexcept;
 
         template<class charT, class traits>
         friend std::basic_ostream<charT, traits>&
@@ -638,7 +1021,7 @@
 
 [section:constructor Default constructor]
 
- id();
+ id() noexcept;
 
 [variablelist
 
@@ -652,7 +1035,7 @@
 
 [section:is_equal `operator==`]
 
- bool operator==(const id& y) const;
+ bool operator==(const id& y) const noexcept;
 
 [variablelist
 
@@ -667,7 +1050,7 @@
 
 [section:not_equal `operator!=`]
 
- bool operator!=(const id& y) const;
+ bool operator!=(const id& y) const noexcept;
 
 [variablelist
 
@@ -682,7 +1065,7 @@
 
 [section:less_than `operator<`]
 
- bool operator<(const id& y) const;
+ bool operator<(const id& y) const noexcept;
 
 [variablelist
 
@@ -701,7 +1084,7 @@
 
 [section:greater_than `operator>`]
 
- bool operator>(const id& y) const;
+ bool operator>(const id& y) const noexcept;
 
 [variablelist
 
@@ -715,7 +1098,7 @@
 
 [section:less_than_or_equal `operator<=`]
 
- bool operator<=(const id& y) const;
+ bool operator<=(const id& y) const noexcept;
 
 [variablelist
 
@@ -729,7 +1112,7 @@
 
 [section:greater_than_or_equal `operator>=`]
 
- bool operator>=(const id& y) const;
+ bool operator>=(const id& y) const noexcept;
 
 [variablelist
 
@@ -761,17 +1144,124 @@
 
 [endsect]
 
+[section:attributes Class `boost::thread::attributes` EXTENSION]
+
+ class thread::attributes {
+ public:
+ attributes() noexcept;
+ ~ attributes()=default;
+ // stack
+ void set_stack_size(std::size_t size) noexcept;
+ std::size_t get_stack_size() const noexcept;
+
+ #if defined BOOST_THREAD_DEFINES_THREAD_ATTRIBUTES_NATIVE_HANDLE
+ typedef platform-specific-type native_handle_type;
+ native_handle_type* native_handle() noexcept;
+ const native_handle_type* native_handle() const noexcept;
+ #endif
+
+ };
+
+[section:constructor Default constructor]
+
+ thread_attributes() noexcept;
+
+[variablelist
+
+[[Effects:] [Constructs a thread atrributes instance with its default values.]]
+
+[[Throws:] [Nothing]]
+
+]
+
 [endsect]
 
+[section: set_stack_size Member function `set_stack_size()`]
+
+ void set_stack_size(std::size_t size) noexcept;
+
+[variablelist
+
+[[Effects:] [Stores the stack size to be used to create a thread. This is an hint that the implementation can choose a better size if to small or too big or not aligned to a page.]]
+
+[[Postconditions:] [`this-> get_stack_size()` returns the chosen stack size.]]
+
+[[Throws:] [Nothing.]]
+
+]
+
+[endsect]
+
+[section:get_stack_size Member function `get_stack_size()`]
+
+ std::size_t get_stack_size() const noexcept;
+
+[variablelist
+
+[[Returns:] [The stack size to be used on the creation of a thread. Note that this function can return 0 meaning the default.]]
+
+[[Throws:] [Nothing.]]
+
+]
+
+[endsect]
+
+[section:nativehandle Member function `native_handle()`]
+
+ typedef platform-specific-type native_handle_type;
+ typedef platform-specific-type native_handle_type;
+ native_handle_type* native_handle() noexcept;
+ const native_handle_type* native_handle() const noexcept;
+
+[variablelist
+
+[[Effects:] [Returns an instance of `native_handle_type` that can be used with platform-specific APIs to manipulate the underlying
+thread attributes implementation. If no such instance exists, `native_handle()` and `native_handle_type` are not present and `BOOST_THREAD_DEFINES_THREAD_ATTRIBUTES_NATIVE_HANDLE` is not defined.]]
+
+[[Throws:] [Nothing.]]
+
+]
+
+[endsect]
+[endsect] [/ thread::attributes ]
+[endsect] [/ thread ]
+
 [section:this_thread Namespace `this_thread`]
 
+
+ namespace boost {
+ namespace this_thread {
+ thread::id get_id() noexcept;
+ template<typename TimeDuration>
+ void yield() noexcept;
+ template <class Clock, class Duration>
+ void sleep_until(const chrono::time_point<Clock, Duration>& abs_time);
+ template <class Rep, class Period>
+ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
+
+ template<typename Callable>
+ void at_thread_exit(Callable func); // EXTENSION
+
+ void interruption_point(); // EXTENSION
+ bool interruption_requested() noexcept; // EXTENSION
+ bool interruption_enabled() noexcept; // EXTENSION
+ class disable_interruption; // EXTENSION
+ class restore_interruption; // EXTENSION
+
+ #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 || defined BOOST_THREAD_DONT_USE_CHRONO
+ void sleep(TimeDuration const& rel_time);
+ void sleep(system_time const& abs_time)
+ #endif
+ }
+ }
+
 [section:get_id Non-member function `get_id()`]
 
     #include <boost/thread/thread.hpp>
 
     namespace this_thread
     {
- thread::id get_id();
+ thread::id get_id() noexcept;
     }
 
 [variablelist
@@ -784,7 +1274,7 @@
 
 [endsect]
 
-[section:interruption_point Non-member function `interruption_point()`]
+[section:interruption_point Non-member function `interruption_point()` EXTENSION]
 
     #include <boost/thread/thread.hpp>
 
@@ -803,13 +1293,13 @@
 
 [endsect]
 
-[section:interruption_requested Non-member function `interruption_requested()`]
+[section:interruption_requested Non-member function `interruption_requested()` EXTENSION]
 
     #include <boost/thread/thread.hpp>
 
     namespace this_thread
     {
- bool interruption_requested();
+ bool interruption_requested() noexcept;
     }
 
 [variablelist
@@ -822,13 +1312,13 @@
 
 [endsect]
 
-[section:interruption_enabled Non-member function `interruption_enabled()`]
+[section:interruption_enabled Non-member function `interruption_enabled()` EXTENSION]
 
     #include <boost/thread/thread.hpp>
 
     namespace this_thread
     {
- bool interruption_enabled();
+ bool interruption_enabled() noexcept;
     }
 
 [variablelist
@@ -862,17 +1352,68 @@
 
 [[Notes:] [`sleep()` is one of the predefined __interruption_points__.]]
 
+[[See:] [Use `__sleep_for()` and `__sleep_until()` instead.]]
+
+]
+
+[endsect]
+
+[section:sleep_until Non-member function `sleep_until()`]
+
+ #include <boost/thread/thread.hpp>
+
+ namespace this_thread
+ {
+ template <class Clock, class Duration>
+ void sleep_until(const chrono::time_point<Clock, Duration>& abs_time);
+ }
+
+[variablelist
+
+[[Effects:] [Suspends the current thread until the time period
+specified by `rel_time` has elapsed or the time point specified by
+`abs_time` has been reached.]]
+
+[[Throws:] [Nothing if Clock satisfies the TrivialClock requirements and operations of Duration
+do not throw exceptions. __thread_interrupted__ if the current thread of execution is interrupted. ]]
+
+[[Notes:] [`sleep_until()` is one of the predefined __interruption_points__.]]
+
 ]
 
 [endsect]
 
+[section:sleep_for Non-member function `sleep_for()`]
+
+ #include <boost/thread/thread.hpp>
+
+ namespace this_thread
+ {
+ template <class Rep, class Period>
+ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
+ }
+
+[variablelist
+
+[[Effects:] [Suspends the current thread until the time point specified by
+`abs_time` has been reached.]]
+
+[[Throws:] [Nothing if operations of chrono::duration<Rep, Period> do not throw exceptions. __thread_interrupted__ if the current thread of execution is interrupted.]]
+
+[[Notes:] [`sleep_for()` is one of the predefined __interruption_points__.]]
+
+]
+
+[endsect]
+
+
 [section:yield Non-member function `yield()`]
 
     #include <boost/thread/thread.hpp>
 
     namespace this_thread
     {
- void yield();
+ void yield() noexcept;
     }
 
 [variablelist
@@ -885,7 +1426,7 @@
 
 [endsect]
 
-[section:disable_interruption Class `disable_interruption`]
+[section:disable_interruption Class `disable_interruption` EXTENSION]
 
     #include <boost/thread/thread.hpp>
 
@@ -894,8 +1435,10 @@
         class disable_interruption
         {
         public:
- disable_interruption();
- ~disable_interruption();
+ disable_interruption(const disable_interruption&) = delete;
+ disable_interruption& operator=(const disable_interruption&) = delete;
+ disable_interruption() noexcept;
+ ~disable_interruption() noexcept;
         };
     }
 
@@ -904,7 +1447,7 @@
 
 [section:constructor Constructor]
 
- disable_interruption();
+ disable_interruption() noexcept;
 
 [variablelist
 
@@ -920,7 +1463,7 @@
 
 [section:destructor Destructor]
 
- ~disable_interruption();
+ ~disable_interruption() noexcept;
 
 [variablelist
 
@@ -938,7 +1481,7 @@
 
 [endsect]
 
-[section:restore_interruption Class `restore_interruption`]
+[section:restore_interruption Class `restore_interruption` EXTENSION]
 
     #include <boost/thread/thread.hpp>
 
@@ -947,8 +1490,10 @@
         class restore_interruption
         {
         public:
- explicit restore_interruption(disable_interruption& disabler);
- ~restore_interruption();
+ restore_interruption(const restore_interruption&) = delete;
+ restore_interruption& operator=(const restore_interruption&) = delete;
+ explicit restore_interruption(disable_interruption& disabler) noexcept;
+ ~restore_interruption() noexcept;
         };
     }
 
@@ -958,7 +1503,7 @@
 
 [section:constructor Constructor]
 
- explicit restore_interruption(disable_interruption& disabler);
+ explicit restore_interruption(disable_interruption& disabler) noexcept;
 
 [variablelist
 
@@ -976,7 +1521,7 @@
 
 [section:destructor Destructor]
 
- ~restore_interruption();
+ ~restore_interruption() noexcept;
 
 [variablelist
 
@@ -994,7 +1539,7 @@
 
 [endsect]
 
-[section:atthreadexit Non-member function template `at_thread_exit()`]
+[section:atthreadexit Non-member function template `at_thread_exit()` EXTENSION]
 
     #include <boost/thread/thread.hpp>
 

Modified: branches/release/libs/thread/doc/time.qbk
==============================================================================
--- branches/release/libs/thread/doc/time.qbk (original)
+++ branches/release/libs/thread/doc/time.qbk 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -5,19 +5,31 @@
   http://www.boost.org/LICENSE_1_0.txt).
 ]
 
-[section:time Date and Time Requirements]
+[section:time Time Requirements]
 
-As of Boost 1.35.0, the __boost_thread__ library uses the [link date_time Boost.Date_Time] library for all operations that require a
-time out. These include (but are not limited to):
+As of Boost 1.50.0, the __boost_thread__ library uses Boost.Chrono library for all operations that require a
+time out as defined in the standard c++11. These include (but are not limited to):
+
+* __sleep_for
+* __sleep_until
+* __try_join_for
+* __try_join_until
+* __wait_for
+* __wait_until
+* __try_lock_for
+* __try_lock_until
+
+[section:deprecated Deprecated]
+The time related functions introduced in Boost 1.35.0, using the [link date_time Boost.Date_Time] library are deprecated. These include (but are not limited to):
 
 * __sleep__
 * __timed_join__
 * __cond_timed_wait__
 * __timed_lock_ref__
 
-For the overloads that accept an absolute time parameter, an object of type [link thread.time.system_time `boost::system_time`] is
+For the overloads that accept an absolute time parameter, an object of type [link thread.time.deprecated.system_time `boost::system_time`] is
 required. Typically, this will be obtained by adding a duration to the current time, obtained with a call to [link
-thread.time.get_system_time `boost::get_system_time()`]. e.g.
+thread.time.deprecated.get_system_time `boost::get_system_time()`]. e.g.
 
     boost::system_time const timeout=boost::get_system_time() + boost::posix_time::milliseconds(500);
 
@@ -70,6 +82,7 @@
 ]
 
 [endsect]
+[endsect]
 
 
 [endsect]
\ No newline at end of file

Modified: branches/release/libs/thread/example/condition.cpp
==============================================================================
--- branches/release/libs/thread/example/condition.cpp (original)
+++ branches/release/libs/thread/example/condition.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,7 +1,7 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <iostream>

Modified: branches/release/libs/thread/example/monitor.cpp
==============================================================================
--- branches/release/libs/thread/example/monitor.cpp (original)
+++ branches/release/libs/thread/example/monitor.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,7 +1,7 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <vector>
@@ -89,6 +89,7 @@
 template <typename M>
 void do_test(M* dummy=0)
 {
+ (void)dummy;
     typedef buffer_t<M> buffer_type;
     buffer_type::get_buffer();
     boost::thread thrd1(&buffer_type::do_receiver_thread);

Modified: branches/release/libs/thread/example/once.cpp
==============================================================================
--- branches/release/libs/thread/example/once.cpp (original)
+++ branches/release/libs/thread/example/once.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,15 +1,22 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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)
 
+#define BOOST_THREAD_PROVIDES_ONCE_CXX11
+
 #include <boost/thread/thread.hpp>
 #include <boost/thread/once.hpp>
 #include <cassert>
 
 int value=0;
+#ifdef BOOST_THREAD_PROVIDES_ONCE_CXX11
+boost::once_flag once;
+#else
 boost::once_flag once = BOOST_ONCE_INIT;
+boost::once_flag once2 = once;
+#endif
 
 void init()
 {
@@ -21,7 +28,7 @@
     boost::call_once(&init, once);
 }
 
-int main(int argc, char* argv[])
+int main()
 {
     boost::thread_group threads;
     for (int i=0; i<5; ++i)

Modified: branches/release/libs/thread/example/starvephil.cpp
==============================================================================
--- branches/release/libs/thread/example/starvephil.cpp (original)
+++ branches/release/libs/thread/example/starvephil.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,7 +1,7 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/mutex.hpp>
@@ -164,7 +164,7 @@
     void* _param;
 };
 
-int main(int argc, char* argv[])
+int main()
 {
     boost::thread thrd_chef(&chef);
     phil p[] = { phil(0), phil(1), phil(2), phil(3), phil(4) };

Modified: branches/release/libs/thread/example/thread.cpp
==============================================================================
--- branches/release/libs/thread/example/thread.cpp (original)
+++ branches/release/libs/thread/example/thread.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,7 +1,7 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/thread.hpp>
@@ -25,7 +25,7 @@
     int m_secs;
 };
 
-int main(int argc, char* argv[])
+int main()
 {
     int secs = 5;
     std::cout << "setting alarm for 5 seconds..." << std::endl;

Modified: branches/release/libs/thread/example/thread_group.cpp
==============================================================================
--- branches/release/libs/thread/example/thread_group.cpp (original)
+++ branches/release/libs/thread/example/thread_group.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,7 +1,7 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/thread.hpp>
@@ -16,7 +16,7 @@
     std::cout << "count = " << ++count << std::endl;
 }
 
-int main(int argc, char* argv[])
+int main()
 {
     boost::thread_group threads;
     for (int i = 0; i < 10; ++i)

Modified: branches/release/libs/thread/example/tss.cpp
==============================================================================
--- branches/release/libs/thread/example/tss.cpp (original)
+++ branches/release/libs/thread/example/tss.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,7 +1,7 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/thread.hpp>
@@ -27,7 +27,7 @@
     }
 }
 
-int main(int argc, char* argv[])
+int main()
 {
     boost::thread_group threads;
     for (int i=0; i<5; ++i)

Modified: branches/release/libs/thread/example/xtime.cpp
==============================================================================
--- branches/release/libs/thread/example/xtime.cpp (original)
+++ branches/release/libs/thread/example/xtime.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,13 +1,13 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/thread.hpp>
 #include <boost/thread/xtime.hpp>
 
-int main(int argc, char* argv[])
+int main()
 {
     boost::xtime xt;
     boost::xtime_get(&xt, boost::TIME_UTC);

Modified: branches/release/libs/thread/src/pthread/once.cpp
==============================================================================
--- branches/release/libs/thread/src/pthread/once.cpp (original)
+++ branches/release/libs/thread/src/pthread/once.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,6 +1,6 @@
 // Copyright (C) 2007 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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)
 
 #define __STDC_CONSTANT_MACROS
@@ -8,6 +8,7 @@
 #include <boost/assert.hpp>
 #include <pthread.h>
 #include <stdlib.h>
+#include <memory>
 
 namespace boost
 {
@@ -21,7 +22,7 @@
         {
             pthread_key_t epoch_tss_key;
             pthread_once_t epoch_tss_key_flag=PTHREAD_ONCE_INIT;
-
+
             extern "C"
             {
                 static void delete_epoch_tss_data(void* data)
@@ -34,8 +35,26 @@
                     BOOST_VERIFY(!pthread_key_create(&epoch_tss_key,delete_epoch_tss_data));
                 }
             }
+
+#if defined BOOST_THREAD_PATCH
+ const pthread_once_t pthread_once_init_value=PTHREAD_ONCE_INIT;
+ struct BOOST_THREAD_DECL delete_epoch_tss_key_on_dlclose_t
+ {
+ delete_epoch_tss_key_on_dlclose_t()
+ {
+ }
+ ~delete_epoch_tss_key_on_dlclose_t()
+ {
+ if(memcmp(&epoch_tss_key_flag, &pthread_once_init_value, sizeof(pthread_once_t)))
+ {
+ pthread_key_delete(epoch_tss_key);
+ }
+ }
+ };
+ delete_epoch_tss_key_on_dlclose_t delete_epoch_tss_key_on_dlclose;
+#endif
         }
-
+
         boost::uintmax_t& get_once_per_thread_epoch()
         {
             BOOST_VERIFY(!pthread_once(&epoch_tss_key_flag,create_epoch_tss_key));
@@ -49,5 +68,5 @@
             return *static_cast<boost::uintmax_t*>(data);
         }
     }
-
+
 }

Modified: branches/release/libs/thread/src/pthread/thread.cpp
==============================================================================
--- branches/release/libs/thread/src/pthread/thread.cpp (original)
+++ branches/release/libs/thread/src/pthread/thread.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,6 +1,7 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
 // Copyright (C) 2007-8 Anthony Williams
+// (C) Copyright 2011 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)
@@ -45,7 +46,11 @@
 
         namespace
         {
+#ifdef BOOST_THREAD_PROVIDES_ONCE_CXX11
+ boost::once_flag current_thread_tls_init_flag;
+#else
             boost::once_flag current_thread_tls_init_flag=BOOST_ONCE_INIT;
+#endif
             pthread_key_t current_thread_tls_key;
 
             extern "C"
@@ -87,6 +92,23 @@
                 }
             }
 
+#if defined BOOST_THREAD_PATCH
+
+ struct delete_current_thread_tls_key_on_dlclose_t
+ {
+ delete_current_thread_tls_key_on_dlclose_t()
+ {
+ }
+ ~delete_current_thread_tls_key_on_dlclose_t()
+ {
+ if (current_thread_tls_init_flag.epoch!=BOOST_ONCE_INITIAL_FLAG_VALUE)
+ {
+ pthread_key_delete(current_thread_tls_key);
+ }
+ }
+ };
+ delete_current_thread_tls_key_on_dlclose_t delete_current_thread_tls_key_on_dlclose;
+#endif
 
             void create_current_thread_tls_key()
             {
@@ -177,7 +199,7 @@
     }
 
 
- thread::thread()
+ thread::thread() BOOST_NOEXCEPT
     {}
 
     void thread::start_thread()
@@ -187,15 +209,47 @@
         if (res != 0)
         {
             thread_info->self.reset();
- boost::throw_exception(thread_resource_error());
+ boost::throw_exception(thread_resource_error(res, "boost thread: failed in pthread_create"));
         }
     }
 
- thread::~thread()
+ void thread::start_thread(const attributes& attr)
     {
- detach();
+ thread_info->self=thread_info;
+ const attributes::native_handle_type* h = attr.native_handle();
+ int res = pthread_create(&thread_info->thread_handle, h, &thread_proxy, thread_info.get());
+ if (res != 0)
+ {
+ thread_info->self.reset();
+ throw thread_resource_error();
+ }
+ int detached_state;
+ res = pthread_attr_getdetachstate(h, &detached_state);
+ if (res != 0)
+ {
+ thread_info->self.reset();
+ throw thread_resource_error();
+ }
+ if (PTHREAD_CREATE_DETACHED==detached_state)
+ {
+ detail::thread_data_ptr local_thread_info;
+ thread_info.swap(local_thread_info);
+
+ if(local_thread_info)
+ {
+ //lock_guard<mutex> lock(local_thread_info->data_mutex);
+ if(!local_thread_info->join_started)
+ {
+ //BOOST_VERIFY(!pthread_detach(local_thread_info->thread_handle));
+ local_thread_info->join_started=true;
+ local_thread_info->joined=true;
+ }
+ }
+ }
     }
 
+
+
     detail::thread_data_ptr thread::get_thread_info BOOST_PREVENT_MACRO_SUBSTITUTION () const
     {
         return thread_info;
@@ -203,6 +257,10 @@
 
     void thread::join()
     {
+ if (this_thread::get_id() == get_id())
+ {
+ boost::throw_exception(thread_resource_error(system::errc::resource_deadlock_would_occur, "boost thread: trying joining itself"));
+ }
         detail::thread_data_ptr const local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
@@ -244,8 +302,12 @@
         }
     }
 
- bool thread::timed_join(system_time const& wait_until)
+ bool thread::do_try_join_until(struct timespec const &timeout)
     {
+ if (this_thread::get_id() == get_id())
+ {
+ boost::throw_exception(thread_resource_error(system::errc::resource_deadlock_would_occur, "boost thread: trying joining itself"));
+ }
         detail::thread_data_ptr const local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
@@ -255,7 +317,7 @@
                 unique_lock<mutex> lock(local_thread_info->data_mutex);
                 while(!local_thread_info->done)
                 {
- if(!local_thread_info->done_condition.timed_wait(lock,wait_until))
+ if(!local_thread_info->done_condition.do_timed_wait(lock,timeout))
                     {
                         return false;
                     }
@@ -291,13 +353,13 @@
         return true;
     }
 
- bool thread::joinable() const
+ bool thread::joinable() const BOOST_NOEXCEPT
     {
         return (get_thread_info)();
     }
 
 
- void thread::detach()
+ void thread::detach() BOOST_NOEXCEPT
     {
         detail::thread_data_ptr local_thread_info;
         thread_info.swap(local_thread_info);
@@ -328,7 +390,7 @@
             if(thread_info)
             {
                 unique_lock<mutex> lk(thread_info->sleep_mutex);
- while(thread_info->sleep_condition.timed_wait(lk,st));
+ while(thread_info->sleep_condition.timed_wait(lk,st)) {}
             }
             else
             {
@@ -361,7 +423,34 @@
             }
         }
 
- void yield()
+#ifdef BOOST_THREAD_USES_CHRONO
+ void
+ sleep_for(const chrono::nanoseconds& ns)
+ {
+ using namespace chrono;
+ if (ns >= nanoseconds::zero())
+ {
+ timespec ts;
+ ts.tv_sec = static_cast<long>(duration_cast<seconds>(ns).count());
+ ts.tv_nsec = static_cast<long>((ns - seconds(ts.tv_sec)).count());
+
+# if defined(BOOST_HAS_PTHREAD_DELAY_NP)
+ BOOST_VERIFY(!pthread_delay_np(&ts));
+# elif defined(BOOST_HAS_NANOSLEEP)
+ // nanosleep takes a timespec that is an offset, not
+ // an absolute time.
+ nanosleep(&ts, 0);
+# else
+ mutex mx;
+ mutex::scoped_lock lock(mx);
+ condition_variable cond;
+ cond.wait_for(lock, ns);
+# endif
+ }
+ }
+#endif
+
+ void yield() BOOST_NOEXCEPT
         {
 # if defined(BOOST_HAS_SCHED_YIELD)
             BOOST_VERIFY(!sched_yield());
@@ -374,8 +463,7 @@
 # endif
         }
     }
-
- unsigned thread::hardware_concurrency()
+ unsigned thread::hardware_concurrency() BOOST_NOEXCEPT
     {
 #if defined(PTW32_VERSION) || defined(__hpux)
         return pthread_num_processors_np();
@@ -393,8 +481,12 @@
 #endif
     }
 
- thread::id thread::get_id() const
+ thread::id thread::get_id() const BOOST_NOEXCEPT
     {
+ #if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
+ //return local_thread_info->thread_handle;
+ return const_cast<thread*>(this)->native_handle();
+ #else
         detail::thread_data_ptr const local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
@@ -402,8 +494,9 @@
         }
         else
         {
- return id();
+ return id();
         }
+ #endif
     }
 
     void thread::interrupt()
@@ -421,7 +514,7 @@
         }
     }
 
- bool thread::interruption_requested() const
+ bool thread::interruption_requested() const BOOST_NOEXCEPT
     {
         detail::thread_data_ptr const local_thread_info=(get_thread_info)();
         if(local_thread_info)
@@ -453,10 +546,14 @@
 
     namespace this_thread
     {
- thread::id get_id()
+ thread::id get_id() BOOST_NOEXCEPT
         {
+ #if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
+ return pthread_self();
+ #else
             boost::detail::thread_data_base* const thread_info=get_or_make_current_thread_data();
             return thread::id(thread_info?thread_info->shared_from_this():detail::thread_data_ptr());
+ #endif
         }
 
         void interruption_point()
@@ -473,13 +570,13 @@
             }
         }
 
- bool interruption_enabled()
+ bool interruption_enabled() BOOST_NOEXCEPT
         {
             boost::detail::thread_data_base* const thread_info=detail::get_current_thread_data();
             return thread_info && thread_info->interrupt_enabled;
         }
 
- bool interruption_requested()
+ bool interruption_requested() BOOST_NOEXCEPT
         {
             boost::detail::thread_data_base* const thread_info=detail::get_current_thread_data();
             if(!thread_info)
@@ -493,7 +590,7 @@
             }
         }
 
- disable_interruption::disable_interruption():
+ disable_interruption::disable_interruption() BOOST_NOEXCEPT:
             interruption_was_enabled(interruption_enabled())
         {
             if(interruption_was_enabled)
@@ -502,7 +599,7 @@
             }
         }
 
- disable_interruption::~disable_interruption()
+ disable_interruption::~disable_interruption() BOOST_NOEXCEPT
         {
             if(detail::get_current_thread_data())
             {
@@ -510,7 +607,7 @@
             }
         }
 
- restore_interruption::restore_interruption(disable_interruption& d)
+ restore_interruption::restore_interruption(disable_interruption& d) BOOST_NOEXCEPT
         {
             if(d.interruption_was_enabled)
             {
@@ -518,7 +615,7 @@
             }
         }
 
- restore_interruption::~restore_interruption()
+ restore_interruption::~restore_interruption() BOOST_NOEXCEPT
         {
             if(detail::get_current_thread_data())
             {

Modified: branches/release/libs/thread/src/win32/thread.cpp
==============================================================================
--- branches/release/libs/thread/src/win32/thread.cpp (original)
+++ branches/release/libs/thread/src/win32/thread.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -26,33 +26,38 @@
 {
     namespace
     {
+#ifdef BOOST_THREAD_PROVIDES_ONCE_CXX11
+ boost::once_flag current_thread_tls_init_flag;
+#else
         boost::once_flag current_thread_tls_init_flag=BOOST_ONCE_INIT;
- DWORD current_thread_tls_key=0;
+#endif
+ #if defined(UNDER_CE)
+ // Windows CE does not define the TLS_OUT_OF_INDEXES constant.
+ DWORD tls_out_of_index=0xFFFFFFFF;
+ #else
+ DWORD tls_out_of_index=TLS_OUT_OF_INDEXES;
+ #endif
+ DWORD current_thread_tls_key=tls_out_of_index;
 
         void create_current_thread_tls_key()
         {
             tss_cleanup_implemented(); // if anyone uses TSS, we need the cleanup linked in
             current_thread_tls_key=TlsAlloc();
- #if defined(UNDER_CE)
- // Windows CE does not define the TLS_OUT_OF_INDEXES constant.
- BOOST_ASSERT(current_thread_tls_key!=0xFFFFFFFF);
- #else
- BOOST_ASSERT(current_thread_tls_key!=TLS_OUT_OF_INDEXES);
- #endif
+ BOOST_ASSERT(current_thread_tls_key!=tls_out_of_index);
         }
 
         void cleanup_tls_key()
         {
- if(current_thread_tls_key)
+ if(current_thread_tls_key!=tls_out_of_index)
             {
                 TlsFree(current_thread_tls_key);
- current_thread_tls_key=0;
+ current_thread_tls_key=tls_out_of_index;
             }
         }
 
         detail::thread_data_base* get_current_thread_data()
         {
- if(!current_thread_tls_key)
+ if(current_thread_tls_key==tls_out_of_index)
             {
                 return 0;
             }
@@ -62,7 +67,7 @@
         void set_current_thread_data(detail::thread_data_base* new_data)
         {
             boost::call_once(current_thread_tls_init_flag,create_current_thread_tls_key);
- if(current_thread_tls_key)
+ if(current_thread_tls_key!=tls_out_of_index)
                 BOOST_VERIFY(TlsSetValue(current_thread_tls_key,new_data));
             else
                 boost::throw_exception(thread_resource_error());
@@ -88,7 +93,7 @@
 
         typedef void* uintptr_t;
 
- inline uintptr_t const _beginthreadex(void* security, unsigned stack_size, unsigned (__stdcall* start_address)(void*),
+ inline uintptr_t _beginthreadex(void* security, unsigned stack_size, unsigned (__stdcall* start_address)(void*),
                                               void* arglist, unsigned initflag, unsigned* thrdaddr)
         {
             DWORD threadID;
@@ -193,7 +198,7 @@
         }
     }
 
- thread::thread()
+ thread::thread() BOOST_NOEXCEPT
     {}
 
     void thread::start_thread()
@@ -208,6 +213,19 @@
         ResumeThread(thread_info->thread_handle);
     }
 
+ void thread::start_thread(const attributes& attr)
+ {
+ //uintptr_t const new_thread=_beginthreadex(attr.get_security(),attr.get_stack_size(),&thread_start_function,thread_info.get(),CREATE_SUSPENDED,&thread_info->id);
+ uintptr_t const new_thread=_beginthreadex(0,attr.get_stack_size(),&thread_start_function,thread_info.get(),CREATE_SUSPENDED,&thread_info->id);
+ if(!new_thread)
+ {
+ boost::throw_exception(thread_resource_error());
+ }
+ intrusive_ptr_add_ref(thread_info.get());
+ thread_info->thread_handle=(detail::win32::handle)(new_thread);
+ ResumeThread(thread_info->thread_handle);
+ }
+
     thread::thread(detail::thread_data_ptr data):
         thread_info(data)
     {}
@@ -257,23 +275,28 @@
 
     }
 
- thread::~thread()
- {
- detach();
- }
-
- thread::id thread::get_id() const
+ thread::id thread::get_id() const BOOST_NOEXCEPT
     {
+ #if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
+ detail::thread_data_ptr local_thread_info=(get_thread_info)();
+ return local_thread_info?local_thread_info->id:0;
+ //return const_cast<thread*>(this)->native_handle();
+ #else
         return thread::id((get_thread_info)());
+ #endif
     }
 
- bool thread::joinable() const
+ bool thread::joinable() const BOOST_NOEXCEPT
     {
         return (get_thread_info)();
     }
 
     void thread::join()
     {
+ if (this_thread::get_id() == get_id())
+ {
+ boost::throw_exception(thread_resource_error(system::errc::resource_deadlock_would_occur, "boost thread: trying joining itself"));
+ }
         detail::thread_data_ptr local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
@@ -284,6 +307,10 @@
 
     bool thread::timed_join(boost::system_time const& wait_until)
     {
+ if (this_thread::get_id() == get_id())
+ {
+ boost::throw_exception(thread_resource_error(system::errc::resource_deadlock_would_occur, "boost thread: trying joining itself"));
+ }
         detail::thread_data_ptr local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
@@ -296,7 +323,30 @@
         return true;
     }
 
- void thread::detach()
+#ifdef BOOST_THREAD_USES_CHRONO
+
+ bool thread::try_join_until(const chrono::time_point<chrono::system_clock, chrono::nanoseconds>& tp)
+ {
+ if (this_thread::get_id() == get_id())
+ {
+ boost::throw_exception(thread_resource_error(system::errc::resource_deadlock_would_occur, "boost thread: trying joining itself"));
+ }
+ detail::thread_data_ptr local_thread_info=(get_thread_info)();
+ if(local_thread_info)
+ {
+ chrono::milliseconds rel_time= chrono::ceil<chrono::milliseconds>(tp-chrono::system_clock::now());
+ if(!this_thread::interruptible_wait(local_thread_info->thread_handle,rel_time.count()))
+ {
+ return false;
+ }
+ release_handle();
+ }
+ return true;
+ }
+
+#endif
+
+ void thread::detach() BOOST_NOEXCEPT
     {
         release_handle();
     }
@@ -315,13 +365,13 @@
         }
     }
 
- bool thread::interruption_requested() const
+ bool thread::interruption_requested() const BOOST_NOEXCEPT
     {
         detail::thread_data_ptr local_thread_info=(get_thread_info)();
         return local_thread_info.get() && (detail::win32::WaitForSingleObject(local_thread_info->interruption_handle,0)==0);
     }
 
- unsigned thread::hardware_concurrency()
+ unsigned thread::hardware_concurrency() BOOST_NOEXCEPT
     {
         SYSTEM_INFO info={{0}};
         GetSystemInfo(&info);
@@ -491,9 +541,14 @@
             return false;
         }
 
- thread::id get_id()
+ thread::id get_id() BOOST_NOEXCEPT
         {
+ #if defined BOOST_THREAD_PROVIDES_BASIC_THREAD_ID
+ //return detail::win32::GetCurrentThread();
+ return detail::win32::GetCurrentThreadId();
+ #else
             return thread::id(get_or_make_current_thread_data());
+ #endif
         }
 
         void interruption_point()
@@ -505,22 +560,22 @@
             }
         }
 
- bool interruption_enabled()
+ bool interruption_enabled() BOOST_NOEXCEPT
         {
             return get_current_thread_data() && get_current_thread_data()->interruption_enabled;
         }
 
- bool interruption_requested()
+ bool interruption_requested() BOOST_NOEXCEPT
         {
             return get_current_thread_data() && (detail::win32::WaitForSingleObject(get_current_thread_data()->interruption_handle,0)==0);
         }
 
- void yield()
+ void yield() BOOST_NOEXCEPT
         {
             detail::win32::Sleep(0);
         }
 
- disable_interruption::disable_interruption():
+ disable_interruption::disable_interruption() BOOST_NOEXCEPT:
             interruption_was_enabled(interruption_enabled())
         {
             if(interruption_was_enabled)
@@ -529,7 +584,7 @@
             }
         }
 
- disable_interruption::~disable_interruption()
+ disable_interruption::~disable_interruption() BOOST_NOEXCEPT
         {
             if(get_current_thread_data())
             {
@@ -537,7 +592,7 @@
             }
         }
 
- restore_interruption::restore_interruption(disable_interruption& d)
+ restore_interruption::restore_interruption(disable_interruption& d) BOOST_NOEXCEPT
         {
             if(d.interruption_was_enabled)
             {
@@ -545,7 +600,7 @@
             }
         }
 
- restore_interruption::~restore_interruption()
+ restore_interruption::~restore_interruption() BOOST_NOEXCEPT
         {
             if(get_current_thread_data())
             {

Modified: branches/release/libs/thread/src/win32/tss_pe.cpp
==============================================================================
--- branches/release/libs/thread/src/win32/tss_pe.cpp (original)
+++ branches/release/libs/thread/src/win32/tss_pe.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -25,7 +25,7 @@
 }
 
 namespace {
- void NTAPI on_tls_callback(void* h, DWORD dwReason, PVOID pv)
+ void NTAPI on_tls_callback(void* , DWORD dwReason, PVOID )
     {
         switch (dwReason)
         {

Modified: branches/release/libs/thread/test/Jamfile.v2
==============================================================================
--- branches/release/libs/thread/test/Jamfile.v2 (original)
+++ branches/release/libs/thread/test/Jamfile.v2 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,6 +1,7 @@
-# (C) Copyright William E. Kempf 2001.
-# (C) Copyright 2007 Anthony Williams.
-# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# (C) Copyright William E. Kempf 2001.
+# (C) Copyright 2007 Anthony Williams.
+# (C) Copyright 2011-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)
 #
 # Boost.Threads test Jamfile
@@ -19,72 +20,516 @@
 import testing ;
 
 project
- : requirements <library>/boost/test//boost_unit_test_framework/<link>static
- <threading>multi
+ : requirements
+ <threading>multi
+
+ <warnings>all
+ <toolset>gcc:<cxxflags>-Wextra
+ <toolset>gcc:<cxxflags>-pedantic
+ <toolset>gcc:<cxxflags>-Wno-long-long
+ #<toolset>gcc:<cxxflags>-ansi
+ #<toolset>gcc:<cxxflags>-fpermissive
+
+ <toolset>darwin:<cxxflags>-Wextra
+ <toolset>darwin:<cxxflags>-pedantic
+ <toolset>darwin:<cxxflags>-Wno-long-long
+ #<toolset>darwin:<cxxflags>-ansi # doesn't work for 4.1.2
+ <toolset>darwin:<cxxflags>-fpermissive
+
+ #<toolset>pathscale:<cxxflags>-Wextra
+ <toolset>pathscale:<cxxflags>-Wno-long-long
+ <toolset>pathscale:<cxxflags>-pedantic
+
+ <toolset>clang:<cxxflags>-Wextra
+ <toolset>clang:<cxxflags>-pedantic
+ <toolset>clang:<cxxflags>-Wno-long-long
+ <toolset>clang:<cxxflags>-ansi
+ #<toolset>clang:<cxxflags>-fpermissive # doesn't work
+
+ <toolset>gcc-mingw-4.4.0:<cxxflags>-fdiagnostics-show-option
+ <toolset>gcc-mingw-4.5.0:<cxxflags>-fdiagnostics-show-option
+ <toolset>gcc-mingw-4.6.0:<cxxflags>-fdiagnostics-show-option
+ <toolset>gcc-mingw-4.6.3:<cxxflags>-fdiagnostics-show-option
+ <toolset>gcc-mingw-4.7.0:<cxxflags>-fdiagnostics-show-option
+ <toolset>gcc-mingw-4.8.0:<cxxflags>-fdiagnostics-show-option
+
+ <toolset>darwin-4.6.2:<cxxflags>-ansi
+ #<toolset>darwin-4.6.2:<cxxflags>-Wno-delete-non-virtual-dtor # doesn't work
+ <toolset>darwin-4.7.0:<cxxflags>-ansi
+ <toolset>darwin-4.7.0:<cxxflags>-Wno-delete-non-virtual-dtor
+
+ #<toolset>clang-2.8:<cxxflags>-Wno-delete-non-virtual-dtor
+ #<toolset>clang-2.8:<cxxflags>-Wno-unused-function
+ #<toolset>clang-2.9:<cxxflags>-Wno-delete-non-virtual-dtor
+ #<toolset>clang-2.9:<cxxflags>-Wno-unused-function
+ <toolset>clang-3.0:<cxxflags>-Wno-delete-non-virtual-dtor
+ #<toolset>clang-3.0:<cxxflags>-Wno-unused-function
+ #<toolset>clang-3.0:<cxxflags>-Wno-unused-variable
+
     ;
 
 rule thread-run ( sources )
 {
- return
+ return
     [ run $(sources) ../build//boost_thread ]
- [ run $(sources) ../src/tss_null.cpp ../build//boost_thread/<link>static
+ [ run $(sources) ../src/tss_null.cpp ../build//boost_thread/<link>static
         : : : : $(sources[1]:B)_lib ]
     ;
-}
+}
+
+rule thread-test ( sources )
+{
+ return
+ [ run $(sources) ../build//boost_thread : : : <library>/boost/test//boost_unit_test_framework/<link>static ]
+ [ run $(sources) ../src/tss_null.cpp ../build//boost_thread/<link>static
+ : : : <library>/boost/test//boost_unit_test_framework/<link>static : $(sources[1]:B)_lib ]
+ ;
+}
 
+rule thread-run2 ( sources : name )
 {
- test-suite "threads"
- : [ thread-run test_thread.cpp ]
- [ thread-run test_thread_id.cpp ]
- [ thread-run test_hardware_concurrency.cpp ]
- [ thread-run test_thread_move.cpp ]
- [ thread-run test_thread_return_local.cpp ]
- [ thread-run test_thread_move_return.cpp ]
- [ thread-run test_thread_launching.cpp ]
- [ thread-run test_thread_mf.cpp ]
- [ thread-run test_thread_exit.cpp ]
- [ thread-run test_move_function.cpp ]
- [ thread-run test_mutex.cpp ]
- [ thread-run test_condition_notify_one.cpp ]
- [ thread-run test_condition_timed_wait_times_out.cpp ]
- [ thread-run test_condition_notify_all.cpp ]
- [ thread-run test_condition.cpp ]
- [ thread-run test_tss.cpp ]
- [ thread-run test_once.cpp ]
- [ thread-run test_xtime.cpp ]
- [ thread-run test_barrier.cpp ]
- [ thread-run test_shared_mutex.cpp ]
- [ thread-run test_shared_mutex_part_2.cpp ]
- [ thread-run test_shared_mutex_timed_locks.cpp ]
- [ thread-run test_lock_concept.cpp ]
- [ thread-run test_generic_locks.cpp ]
- [ thread-run test_futures.cpp ]
+ return
+ [ run $(sources) ../build//boost_thread : : :
+ : $(name) ]
+ [ run $(sources) ../src/tss_null.cpp ../build//boost_thread/<link>static
+ : : :
+ : $(name)_lib ]
+ ;
+}
+
+rule thread-run-lib2 ( sources : name )
+{
+ return
+ [ run $(sources) ../src/tss_null.cpp ../build//boost_thread/<link>static
+ : : :
+ : $(name)_lib ]
+ ;
+}
+
+
+rule thread-compile-fail ( sources : reqs * : name )
+{
+ return
+ [ compile-fail $(sources)
+ : $(reqs)
+ : $(name) ]
+ ;
+}
+
+{
+ test-suite t_threads
+ :
+ [ thread-test test_thread.cpp ]
+ [ thread-test test_thread_id.cpp ]
+ [ thread-test test_hardware_concurrency.cpp ]
+ [ thread-test test_thread_move.cpp ]
+ [ thread-test test_thread_return_local.cpp ]
+ [ thread-test test_thread_move_return.cpp ]
+ [ thread-test test_thread_launching.cpp ]
+ [ thread-test test_thread_mf.cpp ]
+ [ thread-test test_thread_exit.cpp ]
+ [ thread-test test_move_function.cpp ]
           [ compile-fail no_implicit_move_from_lvalue_thread.cpp ]
           [ compile-fail no_implicit_assign_from_lvalue_thread.cpp ]
+ [ thread-test test_tss.cpp ]
+ [ thread-test test_xtime.cpp ]
     ;
 
+ test-suite t_sync
+ :
+ [ thread-test test_mutex.cpp ]
+ [ thread-test test_condition_notify_one.cpp ]
+ [ thread-test test_condition_timed_wait_times_out.cpp ]
+ [ thread-test test_condition_notify_all.cpp ]
+ [ thread-test test_condition.cpp ]
+ [ thread-test test_once.cpp ]
+ [ thread-test test_barrier.cpp ]
+ [ thread-test test_lock_concept.cpp ]
+ [ thread-test test_generic_locks.cpp ]
+ ;
 
- #explicit tickets ;
- test-suite tickets
- :
- [ thread-run test_6170.cpp ]
+ test-suite t_shared
+ :
+ [ thread-test test_shared_mutex.cpp ]
+ [ thread-test test_shared_mutex_part_2.cpp ]
+ [ thread-test test_shared_mutex_timed_locks.cpp ]
+ [ thread-test test_shared_mutex_timed_locks_chrono.cpp ]
+ #uncomment the following once these works on windows
+ #[ thread-test test_vhh_shared_mutex.cpp ]
+ #[ thread-test test_vhh_shared_mutex_part_2.cpp ]
+ #[ thread-test test_vhh_shared_mutex_timed_locks.cpp ]
+ ;
+
+ test-suite t_futures
+ :
+ [ thread-test test_futures.cpp ]
     ;
 
 
- explicit oth_tickets ;
- test-suite oth_tickets
- :
+ #explicit tickets ;
+ test-suite tickets
+ :
+ [ thread-test test_2309.cpp ]
           [ thread-run test_2501.cpp ]
+ [ thread-test test_2741.cpp ]
           [ thread-run test_4521.cpp ]
           [ thread-run test_4648.cpp ]
           [ thread-run test_4882.cpp ]
- [ thread-run test_5351.cpp ]
- [ thread-run test_5502.cpp ]
           [ thread-run test_5542_1.cpp ]
           [ thread-run test_5542_2.cpp ]
           [ thread-run test_5542_3.cpp ]
+ [ thread-run test_5891.cpp ]
           [ thread-run test_6130.cpp ]
+ [ thread-run test_6170.cpp ]
           [ thread-run test_6174.cpp ]
     ;
 
+
+ explicit oth_tickets ;
+ test-suite oth_tickets
+ :
+ [ thread-run test_5351.cpp ]
+ [ thread-run test_5502.cpp ]
+ ;
+
+
+
+ #explicit conditions ;
+ test-suite ts_conditions
+ :
+ [ thread-compile-fail ./sync/conditions/condition_variable/assign_fail.cpp : : condition_variable__assign_f ]
+ [ thread-compile-fail ./sync/conditions/condition_variable/copy_fail.cpp : : condition_variable__copy_f ]
+ [ thread-run2 ./sync/conditions/condition_variable/default_pass.cpp : condition_variable__default_p ]
+ [ thread-run2 ./sync/conditions/condition_variable/dtor_pass.cpp : condition_variable__dtor_p ]
+ [ thread-run2 ./sync/conditions/condition_variable/native_handle_pass.cpp : condition_variable__native_handle_p ]
+ [ thread-run2 ./sync/conditions/condition_variable/wait_for_pass.cpp : condition_variable__wait_for_p ]
+ [ thread-run2 ./sync/conditions/condition_variable/wait_for_pred_pass.cpp : condition_variable__wait_for_pred_p ]
+ [ thread-run2 ./sync/conditions/condition_variable/wait_until_pass.cpp : condition_variable__wait_until_p ]
+ [ thread-run2 ./sync/conditions/condition_variable/wait_until_pred_pass.cpp : condition_variable__wait_until_pred_p ]
+
+ [ thread-compile-fail ./sync/conditions/condition_variable_any/assign_fail.cpp : : condition_variable_any__assign_f ]
+ [ thread-compile-fail ./sync/conditions/condition_variable_any/copy_fail.cpp : : condition_variable_any__copy_f ]
+ [ thread-run2 ./sync/conditions/condition_variable_any/default_pass.cpp : condition_variable_any__default_p ]
+ [ thread-run2 ./sync/conditions/condition_variable_any/dtor_pass.cpp : condition_variable_any__dtor_p ]
+ [ thread-run2 ./sync/conditions/condition_variable_any/wait_for_pass.cpp : condition_variable_any__wait_for_p ]
+ [ thread-run2 ./sync/conditions/condition_variable_any/wait_for_pred_pass.cpp : condition_variable_any__wait_for_pred_p ]
+ [ thread-run2 ./sync/conditions/condition_variable_any/wait_until_pass.cpp : condition_variable_any__wait_until_p ]
+ [ thread-run2 ./sync/conditions/condition_variable_any/wait_until_pred_pass.cpp : condition_variable_any__wait_until_pred_p ]
+ [ thread-run2 ./sync/conditions/cv_status/cv_status_pass.cpp : cv_status__cv_status_p ]
+ ;
+
+ #explicit async ;
+ test-suite ts_async
+ :
+ # [ thread-run2 ./sync/futures/async/async_pass.cpp : async__async_p ]
+ ;
+
+ #explicit promise ;
+ test-suite ts_promise
+ :
+ [ thread-compile-fail ./sync/futures/promise/copy_assign_fail.cpp : : promise__copy_assign_f ]
+ [ thread-compile-fail ./sync/futures/promise/copy_ctor_fail.cpp : : promise__copy_ctor_f ]
+ [ thread-run2 ./sync/futures/promise/alloc_ctor_pass.cpp : promise__alloc_ctor_p ]
+ [ thread-run2 ./sync/futures/promise/default_pass.cpp : promise__default_p ]
+ [ thread-run2 ./sync/futures/promise/dtor_pass.cpp : promise__dtor_p ]
+ [ thread-run2 ./sync/futures/promise/get_future_pass.cpp : promise__get_future_p ]
+ [ thread-run2 ./sync/futures/promise/move_ctor_pass.cpp : promise__move_ctor_p ]
+ [ thread-run2 ./sync/futures/promise/move_assign_pass.cpp : promise__move_asign_p ]
+ [ thread-run2 ./sync/futures/promise/use_allocator_pass.cpp : promise__use_allocator_p ]
+ ;
+
+ #explicit future ;
+ test-suite ts_future
+ :
+ [ thread-compile-fail ./sync/futures/future/copy_assign_fail.cpp : : future__copy_assign_f ]
+ [ thread-compile-fail ./sync/futures/future/copy_ctor_fail.cpp : : future__copy_ctor_f ]
+ [ thread-run2 ./sync/futures/future/default_pass.cpp : future__default_p ]
+ [ thread-run2 ./sync/futures/future/dtor_pass.cpp : future__dtor_p ]
+ #[ thread-run2 ./sync/futures/future/get_pass.cpp : future__get_p ]
+ [ thread-run2 ./sync/futures/future/move_ctor_pass.cpp : future__move_ctor_p ]
+ [ thread-run2 ./sync/futures/future/move_assign_pass.cpp : future__move_asign_p ]
+ [ thread-run2 ./sync/futures/future/share_pass.cpp : future__share_p ]
+ ;
+
+ #explicit packaged_task ;
+ test-suite ts_packaged_task
+ :
+ [ thread-run2 ./sync/futures/packaged_task/alloc_ctor_pass.cpp : packaged_task__alloc_ctor_p ]
+ [ thread-compile-fail ./sync/futures/packaged_task/copy_assign_fail.cpp : : packaged_task__copy_assign_f ]
+ [ thread-compile-fail ./sync/futures/packaged_task/copy_ctor_fail.cpp : : packaged_task__copy_ctor_f ]
+ [ thread-run2 ./sync/futures/packaged_task/default_ctor_pass.cpp : packaged_task__default_ctor_p ]
+ [ thread-run2 ./sync/futures/packaged_task/func_ctor_pass.cpp : packaged_task__func_ctor_p ]
+ #[ thread-run2 ./sync/futures/packaged_task/dtor_pass.cpp : packaged_task__dtor_p ]
+ [ thread-run2 ./sync/futures/packaged_task/get_future_pass.cpp : packaged_task__get_future_p ]
+ [ thread-run2 ./sync/futures/packaged_task/move_ctor_pass.cpp : packaged_task__move_ctor_p ]
+ [ thread-run2 ./sync/futures/packaged_task/move_assign_pass.cpp : packaged_task__move_asign_p ]
+ #[ thread-run2 ./sync/futures/packaged_task/operator_pass.cpp : packaged_task__operator_p ]
+ [ thread-run2 ./sync/futures/packaged_task/reset_pass.cpp : packaged_task__reset_p ]
+ [ thread-run2 ./sync/futures/packaged_task/use_allocator_pass.cpp : packaged_task__use_allocator_p ]
+ [ thread-run2 ./sync/futures/packaged_task/types_pass.cpp : packaged_task__types_p ]
+ [ thread-run2 ./sync/futures/packaged_task/member_swap_pass.cpp : packaged_task__member_swap_p ]
+ [ thread-run2 ./sync/futures/packaged_task/non_member_swap_pass.cpp : packaged_task__non_member_swap_p ]
+ ;
+
+
+ #explicit lock_guard ;
+ test-suite ts_lock_guard
+ :
+ [ thread-compile-fail ./sync/mutual_exclusion/locks/lock_guard/copy_assign_fail.cpp : : lock_guard__cons__copy_assign_f ]
+ [ thread-compile-fail ./sync/mutual_exclusion/locks/lock_guard/copy_ctor_fail.cpp : : lock_guard__cons__copy_ctor_f ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/lock_guard/adopt_lock_pass.cpp : lock_guard__cons__adopt_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/lock_guard/default_pass.cpp : lock_guard__cons__default_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/lock_guard/types_pass.cpp : lock_guard__types_p ]
+ ;
+
+ #explicit unique_lock ;
+ test-suite ts_unique_lock
+ :
+ [ thread-compile-fail ./sync/mutual_exclusion/locks/unique_lock/cons/copy_assign_fail.cpp : : unique_lock__cons__copy_assign_f ]
+ [ thread-compile-fail ./sync/mutual_exclusion/locks/unique_lock/cons/copy_ctor_fail.cpp : : unique_lock__cons__copy_ctor_f ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/adopt_lock_pass.cpp : unique_lock__cons__adopt_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/default_pass.cpp : unique_lock__cons__default_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/defer_lock_pass.cpp : unique_lock__cons__defer_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/duration_pass.cpp : unique_lock__cons__duration_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp : unique_lock__cons__move_assign_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp : unique_lock__cons__move_ctor_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp : unique_lock__cons__move_ctor_upgrade_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_try_pass.cpp : unique_lock__cons__move_ctor_upgrade_lock_try_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_for_pass.cpp : unique_lock__cons__move_ctor_upgrade_lock_for_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_until_pass.cpp : unique_lock__cons__move_ctor_upgrade_lock_until_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/mutex_pass.cpp : unique_lock__cons__mutex_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/time_point_pass.cpp : unique_lock__cons__time_point_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/try_to_lock_pass.cpp : unique_lock__cons__try_to_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/locking/lock_pass.cpp : unique_lock__lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/locking/try_lock_for_pass.cpp : unique_lock__try_lock_for_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/locking/try_lock_pass.cpp : unique_lock__try_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/locking/try_lock_until_pass.cpp : unique_lock__try_lock_until_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/locking/unlock_pass.cpp : unique_lock__unlock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/mod/member_swap_pass.cpp : unique_lock__member_swap_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/mod/non_member_swap_pass.cpp : unique_lock__non_member_swap_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/mod/release_pass.cpp : unique_lock__release_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/obs/mutex_pass.cpp : unique_lock__mutex_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/obs/op_bool_pass.cpp : unique_lock__op_bool_p ]
+ [ thread-compile-fail ./sync/mutual_exclusion/locks/unique_lock/obs/op_int_fail.cpp : : unique_lock__op_int_f ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/obs/owns_lock_pass.cpp : unique_lock__owns_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/types_pass.cpp : unique_lock__types_p ]
+ ;
+
+ #explicit shared_lock ;
+ test-suite ts_shared_lock
+ :
+ [ thread-compile-fail ./sync/mutual_exclusion/locks/shared_lock/cons/copy_assign_fail.cpp : : shared_lock__cons__copy_assign_f ]
+ [ thread-compile-fail ./sync/mutual_exclusion/locks/shared_lock/cons/copy_ctor_fail.cpp : : shared_lock__cons__copy_ctor_f ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/cons/adopt_lock_pass.cpp : shared_lock__cons__adopt_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/cons/default_pass.cpp : shared_lock__cons__default_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/cons/defer_lock_pass.cpp : shared_lock__cons__defer_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/cons/duration_pass.cpp : shared_lock__cons__duration_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp : shared_lock__cons__move_assign_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp : shared_lock__cons__move_ctor_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_unique_lock_pass.cpp : shared_lock__cons__move_ctor_unique_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_upgrade_lock_pass.cpp : shared_lock__cons__move_ctor_upgrade_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/cons/mutex_pass.cpp : shared_lock__cons__mutex_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/cons/time_point_pass.cpp : shared_lock__cons__time_point_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/cons/try_to_lock_pass.cpp : shared_lock__cons__try_to_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/locking/lock_pass.cpp : shared_lock__lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/locking/try_lock_for_pass.cpp : shared_lock__try_lock_for_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/locking/try_lock_pass.cpp : shared_lock__try_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/locking/try_lock_until_pass.cpp : shared_lock__try_lock_until_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/locking/unlock_pass.cpp : shared_lock__unlock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/mod/member_swap_pass.cpp : shared_lock__member_swap_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/mod/non_member_swap_pass.cpp : shared_lock__non_member_swap_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/mod/release_pass.cpp : shared_lock__release_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/obs/mutex_pass.cpp : shared_lock__mutex_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/obs/op_bool_pass.cpp : shared_lock__op_bool_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/obs/owns_lock_pass.cpp : shared_lock__owns_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock/types_pass.cpp : shared_lock__types_p ]
+ ;
+
+ #explicit upgrade_lock ;
+ test-suite ts_upgrade_lock
+ :
+ [ thread-compile-fail ./sync/mutual_exclusion/locks/upgrade_lock/cons/copy_assign_fail.cpp : : upgrade_lock__cons__copy_assign_f ]
+ [ thread-compile-fail ./sync/mutual_exclusion/locks/upgrade_lock/cons/copy_ctor_fail.cpp : : upgrade_lock__cons__copy_ctor_f ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/cons/adopt_lock_pass.cpp : upgrade_lock__cons__adopt_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/cons/default_pass.cpp : upgrade_lock__cons__default_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/cons/defer_lock_pass.cpp : upgrade_lock__cons__defer_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/cons/duration_pass.cpp : upgrade_lock__cons__duration_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp : upgrade_lock__cons__move_assign_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp : upgrade_lock__cons__move_ctor_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_unique_lock_pass.cpp : upgrade_lock__cons__move_ctor_unique_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/cons/mutex_pass.cpp : upgrade_lock__cons__mutex_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/cons/time_point_pass.cpp : upgrade_lock__cons__time_point_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/cons/try_to_lock_pass.cpp : upgrade_lock__cons__try_to_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/locking/lock_pass.cpp : upgrade_lock__lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_for_pass.cpp : upgrade_lock__try_lock_for_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_pass.cpp : upgrade_lock__try_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/locking/try_lock_until_pass.cpp : upgrade_lock__try_lock_until_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/locking/unlock_pass.cpp : upgrade_lock__unlock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/mod/member_swap_pass.cpp : upgrade_lock__member_swap_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/mod/non_member_swap_pass.cpp : upgrade_lock__non_member_swap_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/mod/release_pass.cpp : upgrade_lock__release_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/obs/mutex_pass.cpp : upgrade_lock__mutex_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/obs/op_bool_pass.cpp : upgrade_lock__op_bool_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/obs/owns_lock_pass.cpp : upgrade_lock__owns_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/types_pass.cpp : upgrade_lock__types_p ]
+ ;
+
+ #explicit mutexs ;
+ test-suite ts_mutex
+ :
+ [ thread-compile-fail ./sync/mutual_exclusion/mutex/assign_fail.cpp : : mutex__assign_f ]
+ [ thread-compile-fail ./sync/mutual_exclusion/mutex/copy_fail.cpp : : mutex__copy_f ]
+ [ thread-run2 ./sync/mutual_exclusion/mutex/default_pass.cpp : mutex__default_p ]
+ [ thread-run2 ./sync/mutual_exclusion/mutex/lock_pass.cpp : mutex__lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/mutex/native_handle_pass.cpp : mutex__native_handle_p ]
+ [ thread-run2 ./sync/mutual_exclusion/mutex/try_lock_pass.cpp : mutex__try_lock_p ]
+ ;
+
+ #explicit recursive_mutex ;
+ test-suite ts_recursive_mutex
+ :
+ [ thread-compile-fail ./sync/mutual_exclusion/recursive_mutex/assign_fail.cpp : : recursive_mutex__assign_f ]
+ [ thread-compile-fail ./sync/mutual_exclusion/recursive_mutex/copy_fail.cpp : : recursive_mutex__copy_f ]
+ [ thread-run2 ./sync/mutual_exclusion/recursive_mutex/default_pass.cpp : recursive_mutex__default_p ]
+ [ thread-run2 ./sync/mutual_exclusion/recursive_mutex/lock_pass.cpp : recursive_mutex__lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/recursive_mutex/native_handle_pass.cpp : recursive_mutex__native_handle_p ]
+ [ thread-run2 ./sync/mutual_exclusion/recursive_mutex/try_lock_pass.cpp : recursive_mutex__try_lock_p ]
+ ;
+
+ #explicit recursive_timed_mutex ;
+ test-suite ts_recursive_timed_mutex
+ :
+ [ thread-compile-fail ./sync/mutual_exclusion/recursive_timed_mutex/assign_fail.cpp : : recursive_timed_mutex__assign_f ]
+ [ thread-compile-fail ./sync/mutual_exclusion/recursive_timed_mutex/copy_fail.cpp : : recursive_timed_mutex__copy_f ]
+ [ thread-run2 ./sync/mutual_exclusion/recursive_timed_mutex/default_pass.cpp : recursive_timed_mutex__default_p ]
+ [ thread-run2 ./sync/mutual_exclusion/recursive_timed_mutex/lock_pass.cpp : recursive_timed_mutex__lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/recursive_timed_mutex/native_handle_pass.cpp : recursive_timed_mutex__native_handle_p ]
+ [ thread-run2 ./sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp : recursive_timed_mutex__try_lock_for_p ]
+ [ thread-run2 ./sync/mutual_exclusion/recursive_timed_mutex/try_lock_pass.cpp : recursive_timed_mutex__try_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/recursive_timed_mutex/try_lock_until_pass.cpp : recursive_timed_mutex__try_lock_until_p ]
+ ;
+
+ #explicit timed_mutex ;
+ test-suite ts_timed_mutex
+ :
+ [ thread-compile-fail ./sync/mutual_exclusion/timed_mutex/assign_fail.cpp : : timed_mutex__assign_f ]
+ [ thread-compile-fail ./sync/mutual_exclusion/timed_mutex/copy_fail.cpp : : timed_mutex__copy_f ]
+ [ thread-run2 ./sync/mutual_exclusion/timed_mutex/default_pass.cpp : timed_mutex__default_p ]
+ [ thread-run2 ./sync/mutual_exclusion/timed_mutex/lock_pass.cpp : timed_mutex__lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/timed_mutex/native_handle_pass.cpp : timed_mutex__native_handle_p ]
+ [ thread-run2 ./sync/mutual_exclusion/timed_mutex/try_lock_for_pass.cpp : timed_mutex__try_lock_for_p ]
+ [ thread-run2 ./sync/mutual_exclusion/timed_mutex/try_lock_pass.cpp : timed_mutex__try_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/timed_mutex/try_lock_until_pass.cpp : timed_mutex__try_lock_until_p ]
+ ;
+
+ #explicit shared_mutexs ;
+ test-suite ts_shared_mutex
+ :
+ [ thread-compile-fail ./sync/mutual_exclusion/shared_mutex/assign_fail.cpp : : shared_mutex__assign_f ]
+ [ thread-compile-fail ./sync/mutual_exclusion/shared_mutex/copy_fail.cpp : : shared_mutex__copy_f ]
+ [ thread-run2 ./sync/mutual_exclusion/shared_mutex/default_pass.cpp : shared_mutex__default_p ]
+ [ thread-run2 ./sync/mutual_exclusion/shared_mutex/lock_pass.cpp : shared_mutex__lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/shared_mutex/try_lock_for_pass.cpp : shared_mutex__try_lock_for_p ]
+ [ thread-run2 ./sync/mutual_exclusion/shared_mutex/try_lock_pass.cpp : shared_mutex__try_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/shared_mutex/try_lock_until_pass.cpp : shared_mutex__try_lock_until_p ]
+
+ ;
+
+ #explicit this_thread ;
+ test-suite ts_this_thread
+ :
+ [ thread-run2 ./threads/this_thread/get_id/get_id_pass.cpp : this_thread__get_id_p ]
+ [ thread-run2 ./threads/this_thread/sleep_for/sleep_for_pass.cpp : this_thread__sleep_for_p ]
+ [ thread-run2 ./threads/this_thread/sleep_until/sleep_until_pass.cpp : this_thread__sleep_until_p ]
+ ;
+
+ #explicit thread ;
+ test-suite ts_thread
+ :
+ [ thread-compile-fail ./threads/thread/assign/copy_fail.cpp : : thread__assign__copy_f ]
+ [ thread-run2 ./threads/thread/assign/move_pass.cpp : thread__assign__move_p ]
+ [ thread-compile-fail ./threads/thread/constr/copy_fail.cpp : : thread__constr__copy_f ]
+ [ thread-run2 ./threads/thread/constr/default_pass.cpp : thread__constr__default_p ]
+ [ thread-run-lib2 ./threads/thread/constr/F_pass.cpp : thread__constr__F_p ]
+ [ thread-run-lib2 ./threads/thread/constr/FArgs_pass.cpp : thread__constr__FArgs_p ]
+ [ thread-run2 ./threads/thread/constr/Frvalue_pass.cpp : thread__constr__Frvalue_p ]
+ #[ thread-run2 ./threads/thread/constr/FrvalueArgs_pass.cpp : thread__constr__FrvalueArgs_p ]
+ [ thread-run2 ./threads/thread/constr/move_pass.cpp : thread__constr__move_p ]
+ [ thread-run2 ./threads/thread/destr/dtor_pass.cpp : thread__destr__dtor_p ]
+ [ thread-run2 ./threads/thread/id/hash_pass.cpp : thread__id__hash_p ]
+ [ thread-run2 ./threads/thread/members/detach_pass.cpp : thread__detach_p ]
+ [ thread-run2 ./threads/thread/members/get_id_pass.cpp : thread__get_id_p ]
+ [ thread-run2 ./threads/thread/members/join_pass.cpp : thread__join_p ]
+ [ thread-run2 ./threads/thread/members/joinable_pass.cpp : thread__joinable_p ]
+ [ thread-run2 ./threads/thread/members/native_handle_pass.cpp : thread__native_handle_p ]
+ [ thread-run2 ./threads/thread/members/swap_pass.cpp : thread__swap_p ]
+ [ thread-run2 ./threads/thread/non_members/swap_pass.cpp : swap_threads_p ]
+ [ thread-run2 ./threads/thread/static/hardware_concurrency_pass.cpp : thread__hardware_concurrency_p ]
+ ;
+
+ #explicit ts_container ;
+ test-suite ts_container
+ :
+ [ thread-run2 ./threads/container/thread_vector_pass.cpp : container__thread_vector_p ]
+ [ thread-run2 ./threads/container/thread_ptr_list_pass.cpp : container__thread_ptr_list_p ]
+ ;
+
+ #explicit examples ;
+ test-suite ts_examples
+ :
+ [ thread-run ../example/monitor.cpp ]
+ [ compile ../example/starvephil.cpp ]
+ #[ compile ../example/tennis.cpp ]
+ [ compile ../example/condition.cpp ]
+ [ thread-run ../example/mutex.cpp ]
+ [ thread-run ../example/once.cpp ]
+ [ thread-run ../example/recursive_mutex.cpp ]
+ [ thread-run2 ../example/thread.cpp : ex_thread ]
+ [ thread-run ../example/thread_group.cpp ]
+ [ thread-run ../example/tss.cpp ]
+ [ thread-run ../example/xtime.cpp ]
+ [ thread-run ../example/shared_monitor.cpp ]
+ [ thread-run ../example/shared_mutex.cpp ]
+ #[ thread-run ../example/vhh_shared_monitor.cpp ]
+ #[ thread-run ../example/vhh_shared_mutex.cpp ]
+ ;
+
+ #explicit shared_upwards ;
+ test-suite ts_shared_upwards
+ :
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_try_pass.cpp : unique_lock__cons__move_ctor_shared_lock_try_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_for_pass.cpp : unique_lock__cons__move_ctor_shared_lock_for_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_shared_lock_until_pass.cpp : unique_lock__cons__move_ctor_shared_lock_until_p ]
+
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_try_pass.cpp : upgrade_lock__cons__move_ctor_shared_lock_try_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_for_pass.cpp : upgrade_lock__cons__move_ctor_shared_lock_for_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_shared_lock_until_pass.cpp : upgrade_lock__cons__move_ctor_shared_lock_until_p ]
+ ;
+
+
+ #explicit shared_lock_guard ;
+ test-suite ts_shared_lock_guard
+ :
+ [ thread-compile-fail ./sync/mutual_exclusion/locks/shared_lock_guard/copy_assign_fail.cpp : : shared_lock_guard__cons__copy_assign_f ]
+ [ thread-compile-fail ./sync/mutual_exclusion/locks/shared_lock_guard/copy_ctor_fail.cpp : : shared_lock_guard__cons__copy_ctor_f ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock_guard/adopt_lock_pass.cpp : shared_lock_guard__cons__adopt_lock_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock_guard/default_pass.cpp : shared_lock_guard__cons__default_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/shared_lock_guard/types_pass.cpp : shared_lock_guard__types_p ]
+ ;
+
+ #explicit reverse_lock ;
+ test-suite ts_reverse_lock
+ :
+ [ thread-compile-fail ./sync/mutual_exclusion/locks/reverse_lock/copy_assign_fail.cpp : : reverse_lock__copy_assign_f ]
+ [ thread-compile-fail ./sync/mutual_exclusion/locks/reverse_lock/copy_ctor_fail.cpp : : reverse_lock__copy_ctor_f ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/reverse_lock/unique_lock_ctor_pass.cpp : reverse_lock__unique_lock_ctor_p ]
+ [ thread-run2 ./sync/mutual_exclusion/locks/reverse_lock/types_pass.cpp : reverse_lock__types_p ]
+ ;
+
+ explicit ts ;
+ test-suite ts
+ :
+ [ thread-run test_ml.cpp ]
+ ;
+
 }

Modified: branches/release/libs/thread/test/no_implicit_assign_from_lvalue_thread.cpp
==============================================================================
--- branches/release/libs/thread/test/no_implicit_assign_from_lvalue_thread.cpp (original)
+++ branches/release/libs/thread/test/no_implicit_assign_from_lvalue_thread.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,6 +1,6 @@
 // Copyright (C) 2008 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/thread.hpp>
 
@@ -13,3 +13,15 @@
     boost::thread t2;
     t2=t1;
 }
+
+void remove_unused_warning()
+{
+ //../../../boost/system/error_code.hpp:214:36: warning: Ôboost::system::posix_categoryÕ defined but not used [-Wunused-variable]
+ //../../../boost/system/error_code.hpp:215:36: warning: Ôboost::system::errno_ecatÕ defined but not used [-Wunused-variable]
+ //../../../boost/system/error_code.hpp:216:36: warning: Ôboost::system::native_ecatÕ defined but not used [-Wunused-variable]
+
+ (void)boost::system::posix_category;
+ (void)boost::system::errno_ecat;
+ (void)boost::system::native_ecat;
+
+}

Modified: branches/release/libs/thread/test/no_implicit_move_from_lvalue_thread.cpp
==============================================================================
--- branches/release/libs/thread/test/no_implicit_move_from_lvalue_thread.cpp (original)
+++ branches/release/libs/thread/test/no_implicit_move_from_lvalue_thread.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,6 +1,6 @@
 // Copyright (C) 2008 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/thread.hpp>
 
@@ -12,3 +12,15 @@
     boost::thread t1(do_nothing);
     boost::thread t2(t1);
 }
+
+void remove_unused_warning()
+{
+ //../../../boost/system/error_code.hpp:214:36: warning: Ôboost::system::posix_categoryÕ defined but not used [-Wunused-variable]
+ //../../../boost/system/error_code.hpp:215:36: warning: Ôboost::system::errno_ecatÕ defined but not used [-Wunused-variable]
+ //../../../boost/system/error_code.hpp:216:36: warning: Ôboost::system::native_ecatÕ defined but not used [-Wunused-variable]
+
+ (void)boost::system::posix_category;
+ (void)boost::system::errno_ecat;
+ (void)boost::system::native_ecat;
+
+}

Modified: branches/release/libs/thread/test/test_barrier.cpp
==============================================================================
--- branches/release/libs/thread/test/test_barrier.cpp (original)
+++ branches/release/libs/thread/test/test_barrier.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,7 +1,7 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/detail/config.hpp>
@@ -51,7 +51,7 @@
         g.join_all();
         throw;
     }
-
+
     BOOST_CHECK_EQUAL(global_parameter,5);
 }
 
@@ -64,3 +64,16 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_condition.cpp
==============================================================================
--- branches/release/libs/thread/test/test_condition.cpp (original)
+++ branches/release/libs/thread/test/test_condition.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -2,7 +2,7 @@
 // William E. Kempf
 // Copyright (C) 2007 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/detail/config.hpp>
@@ -45,7 +45,7 @@
     int _val;
 private:
     void operator=(cond_predicate&);
-
+
 };
 
 void condition_test_waits(condition_test_data* data)
@@ -188,3 +188,16 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_condition_notify_all.cpp
==============================================================================
--- branches/release/libs/thread/test/test_condition_notify_all.cpp (original)
+++ branches/release/libs/thread/test/test_condition_notify_all.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,6 +1,6 @@
 // Copyright (C) 2007 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/detail/config.hpp>
@@ -171,7 +171,7 @@
         multiple_wake_cond.wait(lk);
         ++multiple_wake_count;
     }
-
+
 }
 
 
@@ -189,7 +189,7 @@
     multiple_wake_cond.notify_one();
     multiple_wake_cond.notify_all();
     boost::this_thread::sleep(boost::posix_time::milliseconds(200));
-
+
     {
         boost::mutex::scoped_lock lk(multiple_wake_mutex);
         BOOST_CHECK(multiple_wake_count==3);
@@ -220,3 +220,16 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_condition_notify_one.cpp
==============================================================================
--- branches/release/libs/thread/test/test_condition_notify_one.cpp (original)
+++ branches/release/libs/thread/test/test_condition_notify_one.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,6 +1,6 @@
 // Copyright (C) 2007 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/detail/config.hpp>
@@ -15,7 +15,7 @@
 void do_test_condition_notify_one_wakes_from_wait()
 {
     wait_for_flag data;
-
+
     boost::thread thread(bind(&wait_for_flag::wait_without_predicate, data));
 
     {
@@ -31,7 +31,7 @@
 void do_test_condition_notify_one_wakes_from_wait_with_predicate()
 {
     wait_for_flag data;
-
+
     boost::thread thread(bind(&wait_for_flag::wait_with_predicate, data));
 
     {
@@ -47,7 +47,7 @@
 void do_test_condition_notify_one_wakes_from_timed_wait()
 {
     wait_for_flag data;
-
+
     boost::thread thread(bind(&wait_for_flag::timed_wait_without_predicate, data));
 
     {
@@ -63,7 +63,7 @@
 void do_test_condition_notify_one_wakes_from_timed_wait_with_predicate()
 {
     wait_for_flag data;
-
+
     boost::thread thread(bind(&wait_for_flag::timed_wait_with_predicate, data));
 
     {
@@ -79,7 +79,7 @@
 void do_test_condition_notify_one_wakes_from_relative_timed_wait_with_predicate()
 {
     wait_for_flag data;
-
+
     boost::thread thread(bind(&wait_for_flag::relative_timed_wait_with_predicate, data));
 
     {
@@ -104,7 +104,7 @@
         multiple_wake_cond.wait(lk);
         ++multiple_wake_count;
     }
-
+
 }
 
 
@@ -122,7 +122,7 @@
     multiple_wake_cond.notify_one();
     multiple_wake_cond.notify_one();
     boost::this_thread::sleep(boost::posix_time::milliseconds(200));
-
+
     {
         boost::mutex::scoped_lock lk(multiple_wake_mutex);
         BOOST_CHECK(multiple_wake_count==3);
@@ -153,3 +153,16 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_condition_timed_wait_times_out.cpp
==============================================================================
--- branches/release/libs/thread/test/test_condition_timed_wait_times_out.cpp (original)
+++ branches/release/libs/thread/test/test_condition_timed_wait_times_out.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,6 +1,6 @@
 // Copyright (C) 2007-8 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/detail/config.hpp>
@@ -31,7 +31,7 @@
     boost::system_time const start=boost::get_system_time();
     boost::system_time const timeout=start+delay;
 
- while(cond.timed_wait(lock,timeout));
+ while(cond.timed_wait(lock,timeout)) {}
 
     boost::system_time const end=boost::get_system_time();
     BOOST_CHECK((delay-timeout_resolution)<=(end-start));
@@ -79,7 +79,7 @@
     boost::mutex::scoped_lock lock(m);
     boost::system_time const start=boost::get_system_time();
 
- while(cond.timed_wait(lock,delay));
+ while(cond.timed_wait(lock,delay)) {}
 
     boost::system_time const end=boost::get_system_time();
     BOOST_CHECK((delay-timeout_resolution)<=(end-start));
@@ -95,7 +95,7 @@
     boost::system_time const start=boost::get_system_time();
     boost::system_time const timeout=start+delay;
 
- while(cond.timed_wait(lock,timeout));
+ while(cond.timed_wait(lock,timeout)) {}
 
     boost::system_time const end=boost::get_system_time();
     BOOST_CHECK((delay-timeout_resolution)<=(end-start));
@@ -143,7 +143,7 @@
     boost::mutex::scoped_lock lock(m);
     boost::system_time const start=boost::get_system_time();
 
- while(cond.timed_wait(lock,delay));
+ while(cond.timed_wait(lock,delay)) {}
 
     boost::system_time const end=boost::get_system_time();
     BOOST_CHECK((delay-timeout_resolution)<=(end-start));
@@ -171,3 +171,16 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_futures.cpp
==============================================================================
--- branches/release/libs/thread/test/test_futures.cpp (original)
+++ branches/release/libs/thread/test/test_futures.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,4 +1,4 @@
-// (C) Copyright 2008-10 Anthony Williams
+// (C) Copyright 2008-10 Anthony Williams
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -11,9 +11,13 @@
 #include <utility>
 #include <memory>
 #include <string>
+#include <iostream>
 
 #include <boost/test/unit_test.hpp>
 
+#define LOG \
+ if (false) {} else std::cout << std::endl << __FILE__ << "[" << __LINE__ << "]"
+
 #ifndef BOOST_NO_RVALUE_REFERENCES
     template<typename T>
     typename boost::remove_reference<T>::type&& cast_to_rval(T&& t)
@@ -21,43 +25,35 @@
         return static_cast<typename boost::remove_reference<T>::type&&>(t);
     }
 #else
+#if defined BOOST_THREAD_USES_MOVE
+ template<typename T>
+ boost::rv<T>& cast_to_rval(T& t)
+ {
+ return boost::move(t);
+ }
+#else
     template<typename T>
     boost::detail::thread_move_t<T> cast_to_rval(T& t)
     {
         return boost::move(t);
     }
 #endif
+#endif
 
 struct X
 {
-private:
-
- X(X& other);
-
 public:
-
     int i;
-
+
+ BOOST_THREAD_MOVABLE_ONLY(X)
     X():
         i(42)
     {}
-#ifndef BOOST_NO_RVALUE_REFERENCES
- X(X&& other):
- i(other.i)
- {
- other.i=0;
- }
-#else
- X(boost::detail::thread_move_t<X> other):
- i(other->i)
- {
- other->i=0;
- }
- operator boost::detail::thread_move_t<X>()
+ X(BOOST_THREAD_RV_REF(X) other):
+ i(BOOST_THREAD_RV(other).i)
     {
- return boost::detail::thread_move_t<X>(*this);
+ BOOST_THREAD_RV(other).i=0;
     }
-#endif
     ~X()
     {}
 };
@@ -88,22 +84,39 @@
 
 void test_store_value_from_thread()
 {
+ LOG;
+ try {
     boost::promise<int> pi2;
- boost::unique_future<int> fi2(pi2.get_future());
+ LOG;
+ boost::unique_future<int> fi2(BOOST_THREAD_MAKE_RV_REF(pi2.get_future()));
+ LOG;
     boost::thread(set_promise_thread,&pi2);
+ LOG;
     int j=fi2.get();
+ LOG;
     BOOST_CHECK(j==42);
+ LOG;
     BOOST_CHECK(fi2.is_ready());
+ LOG;
     BOOST_CHECK(fi2.has_value());
+ LOG;
     BOOST_CHECK(!fi2.has_exception());
+ LOG;
     BOOST_CHECK(fi2.get_state()==boost::future_state::ready);
+ LOG;
+ }
+ catch (...)
+ {
+ BOOST_CHECK(false&&"Exception thrown");
+ }
 }
 
 
 void test_store_exception()
 {
+ LOG;
     boost::promise<int> pi3;
- boost::unique_future<int> fi3=pi3.get_future();
+ boost::unique_future<int> fi3(BOOST_THREAD_MAKE_RV_REF(pi3.get_future()));
     boost::thread(set_promise_exception_thread,&pi3);
     try
     {
@@ -114,7 +127,7 @@
     {
         BOOST_CHECK(true);
     }
-
+
     BOOST_CHECK(fi3.is_ready());
     BOOST_CHECK(!fi3.has_value());
     BOOST_CHECK(fi3.has_exception());
@@ -123,6 +136,7 @@
 
 void test_initial_state()
 {
+ LOG;
     boost::unique_future<int> fi;
     BOOST_CHECK(!fi.is_ready());
     BOOST_CHECK(!fi.has_value());
@@ -132,6 +146,7 @@
     try
     {
         i=fi.get();
+ (void)i;
         BOOST_CHECK(false);
     }
     catch(boost::future_uninitialized)
@@ -142,9 +157,10 @@
 
 void test_waiting_future()
 {
+ LOG;
     boost::promise<int> pi;
     boost::unique_future<int> fi;
- fi=pi.get_future();
+ fi=BOOST_THREAD_MAKE_RV_REF(pi.get_future());
 
     int i=0;
     BOOST_CHECK(!fi.is_ready());
@@ -156,8 +172,9 @@
 
 void test_cannot_get_future_twice()
 {
+ LOG;
     boost::promise<int> pi;
- pi.get_future();
+ BOOST_THREAD_MAKE_RV_REF(pi.get_future());
 
     try
     {
@@ -172,12 +189,13 @@
 
 void test_set_value_updates_future_state()
 {
+ LOG;
     boost::promise<int> pi;
     boost::unique_future<int> fi;
- fi=pi.get_future();
+ fi=BOOST_THREAD_MAKE_RV_REF(pi.get_future());
 
     pi.set_value(42);
-
+
     BOOST_CHECK(fi.is_ready());
     BOOST_CHECK(fi.has_value());
     BOOST_CHECK(!fi.has_exception());
@@ -186,12 +204,13 @@
 
 void test_set_value_can_be_retrieved()
 {
+ LOG;
     boost::promise<int> pi;
     boost::unique_future<int> fi;
- fi=pi.get_future();
+ fi=BOOST_THREAD_MAKE_RV_REF(pi.get_future());
 
     pi.set_value(42);
-
+
     int i=0;
     BOOST_CHECK(i=fi.get());
     BOOST_CHECK(i==42);
@@ -203,12 +222,13 @@
 
 void test_set_value_can_be_moved()
 {
+ LOG;
 // boost::promise<int> pi;
 // boost::unique_future<int> fi;
-// fi=pi.get_future();
+// fi=BOOST_THREAD_MAKE_RV_REF(pi.get_future());
 
 // pi.set_value(42);
-
+
 // int i=0;
 // BOOST_CHECK(i=fi.get());
 // BOOST_CHECK(i==42);
@@ -220,8 +240,9 @@
 
 void test_future_from_packaged_task_is_waiting()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int);
- boost::unique_future<int> fi=pt.get_future();
+ boost::unique_future<int> fi(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     int i=0;
     BOOST_CHECK(!fi.is_ready());
     BOOST_CHECK(!fi.has_value());
@@ -232,8 +253,9 @@
 
 void test_invoking_a_packaged_task_populates_future()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int);
- boost::unique_future<int> fi=pt.get_future();
+ boost::unique_future<int> fi(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
 
     pt();
 
@@ -248,6 +270,7 @@
 
 void test_invoking_a_packaged_task_twice_throws()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int);
 
     pt();
@@ -265,6 +288,7 @@
 
 void test_cannot_get_future_twice_from_task()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int);
     pt.get_future();
     try
@@ -280,8 +304,9 @@
 
 void test_task_stores_exception_if_function_throws()
 {
+ LOG;
     boost::packaged_task<int> pt(throw_runtime_error);
- boost::unique_future<int> fi=pt.get_future();
+ boost::unique_future<int> fi(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
 
     pt();
 
@@ -302,13 +327,14 @@
     {
         BOOST_CHECK(!"Unknown exception thrown");
     }
-
+
 }
 
 void test_void_promise()
 {
+ LOG;
     boost::promise<void> p;
- boost::unique_future<void> f=p.get_future();
+ boost::unique_future<void> f(BOOST_THREAD_MAKE_RV_REF(p.get_future()));
     p.set_value();
     BOOST_CHECK(f.is_ready());
     BOOST_CHECK(f.has_value());
@@ -319,8 +345,9 @@
 
 void test_reference_promise()
 {
+ LOG;
     boost::promise<int&> p;
- boost::unique_future<int&> f=p.get_future();
+ boost::unique_future<int&> f(BOOST_THREAD_MAKE_RV_REF(p.get_future()));
     int i=42;
     p.set_value(i);
     BOOST_CHECK(f.is_ready());
@@ -335,8 +362,9 @@
 
 void test_task_returning_void()
 {
+ LOG;
     boost::packaged_task<void> pt(do_nothing);
- boost::unique_future<void> fi=pt.get_future();
+ boost::unique_future<void> fi(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
 
     pt();
 
@@ -355,8 +383,9 @@
 
 void test_task_returning_reference()
 {
+ LOG;
     boost::packaged_task<int&> pt(return_ref);
- boost::unique_future<int&> fi=pt.get_future();
+ boost::unique_future<int&> fi(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
 
     pt();
 
@@ -370,6 +399,7 @@
 
 void test_shared_future()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int);
     boost::unique_future<int> fi=pt.get_future();
 
@@ -389,8 +419,9 @@
 
 void test_copies_of_shared_future_become_ready_together()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int);
- boost::unique_future<int> fi=pt.get_future();
+ boost::unique_future<int> fi(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
 
     boost::shared_future<int> sf(::cast_to_rval(fi));
     boost::shared_future<int> sf2(sf);
@@ -427,8 +458,9 @@
 
 void test_shared_future_can_be_move_assigned_from_unique_future()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int);
- boost::unique_future<int> fi=pt.get_future();
+ boost::unique_future<int> fi(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
 
     boost::shared_future<int> sf;
     sf=::cast_to_rval(fi);
@@ -442,8 +474,9 @@
 
 void test_shared_future_void()
 {
+ LOG;
     boost::packaged_task<void> pt(do_nothing);
- boost::unique_future<void> fi=pt.get_future();
+ boost::unique_future<void> fi(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
 
     boost::shared_future<void> sf(::cast_to_rval(fi));
     BOOST_CHECK(fi.get_state()==boost::future_state::uninitialized);
@@ -459,8 +492,9 @@
 
 void test_shared_future_ref()
 {
+ LOG;
     boost::promise<int&> p;
- boost::shared_future<int&> f(p.get_future());
+ boost::shared_future<int&> f(BOOST_THREAD_MAKE_RV_REF(p.get_future()));
     int i=42;
     p.set_value(i);
     BOOST_CHECK(f.is_ready());
@@ -472,11 +506,12 @@
 
 void test_can_get_a_second_future_from_a_moved_promise()
 {
+ LOG;
     boost::promise<int> pi;
- boost::unique_future<int> fi=pi.get_future();
-
+ boost::unique_future<int> fi(BOOST_THREAD_MAKE_RV_REF(pi.get_future()));
+
     boost::promise<int> pi2(::cast_to_rval(pi));
- boost::unique_future<int> fi2=pi.get_future();
+ boost::unique_future<int> fi2(BOOST_THREAD_MAKE_RV_REF(pi.get_future()));
 
     pi2.set_value(3);
     BOOST_CHECK(fi.is_ready());
@@ -489,11 +524,12 @@
 
 void test_can_get_a_second_future_from_a_moved_void_promise()
 {
+ LOG;
     boost::promise<void> pi;
- boost::unique_future<void> fi=pi.get_future();
-
+ boost::unique_future<void> fi(BOOST_THREAD_MAKE_RV_REF(pi.get_future()));
+
     boost::promise<void> pi2(::cast_to_rval(pi));
- boost::unique_future<void> fi2=pi.get_future();
+ boost::unique_future<void> fi2(BOOST_THREAD_MAKE_RV_REF(pi.get_future()));
 
     pi2.set_value();
     BOOST_CHECK(fi.is_ready());
@@ -504,8 +540,9 @@
 
 void test_unique_future_for_move_only_udt()
 {
+ LOG;
     boost::promise<X> pt;
- boost::unique_future<X> fi=pt.get_future();
+ boost::unique_future<X> fi(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
 
     pt.set_value(X());
     X res(fi.get());
@@ -514,27 +551,28 @@
 
 void test_unique_future_for_string()
 {
+ LOG;
     boost::promise<std::string> pt;
- boost::unique_future<std::string> fi=pt.get_future();
+ boost::unique_future<std::string> fi(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
 
     pt.set_value(std::string("hello"));
     std::string res(fi.get());
     BOOST_CHECK(res=="hello");
 
     boost::promise<std::string> pt2;
- fi=pt2.get_future();
+ fi=BOOST_THREAD_MAKE_RV_REF(pt2.get_future());
 
     std::string const s="goodbye";
-
+
     pt2.set_value(s);
     res=fi.get();
     BOOST_CHECK(res=="goodbye");
 
     boost::promise<std::string> pt3;
- fi=pt3.get_future();
+ fi=BOOST_THREAD_MAKE_RV_REF(pt3.get_future());
 
     std::string s2="foo";
-
+
     pt3.set_value(s2);
     res=fi.get();
     BOOST_CHECK(res=="foo");
@@ -564,9 +602,10 @@
 
 void test_wait_callback()
 {
+ LOG;
     callback_called=0;
     boost::promise<int> pi;
- boost::unique_future<int> fi=pi.get_future();
+ boost::unique_future<int> fi(BOOST_THREAD_MAKE_RV_REF(pi.get_future()));
     pi.set_wait_callback(wait_callback);
     fi.wait();
     BOOST_CHECK(callback_called);
@@ -578,9 +617,10 @@
 
 void test_wait_callback_with_timed_wait()
 {
+ LOG;
     callback_called=0;
     boost::promise<int> pi;
- boost::unique_future<int> fi=pi.get_future();
+ boost::unique_future<int> fi(BOOST_THREAD_MAKE_RV_REF(pi.get_future()));
     pi.set_wait_callback(do_nothing_callback);
     bool success=fi.timed_wait(boost::posix_time::milliseconds(10));
     BOOST_CHECK(callback_called);
@@ -601,6 +641,7 @@
 
 void wait_callback_for_task(boost::packaged_task<int>& pt)
 {
+ LOG;
     boost::lock_guard<boost::mutex> lk(callback_mutex);
     ++callback_called;
     try
@@ -615,9 +656,10 @@
 
 void test_wait_callback_for_packaged_task()
 {
+ LOG;
     callback_called=0;
     boost::packaged_task<int> pt(make_int);
- boost::unique_future<int> fi=pt.get_future();
+ boost::unique_future<int> fi(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     pt.set_wait_callback(wait_callback_for_task);
     fi.wait();
     BOOST_CHECK(callback_called);
@@ -629,12 +671,13 @@
 
 void test_packaged_task_can_be_moved()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int);
 
- boost::unique_future<int> fi=pt.get_future();
+ boost::unique_future<int> fi(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
 
     BOOST_CHECK(!fi.is_ready());
-
+
     boost::packaged_task<int> pt2(::cast_to_rval(pt));
 
     BOOST_CHECK(!fi.is_ready());
@@ -650,17 +693,18 @@
     BOOST_CHECK(!fi.is_ready());
 
     pt2();
-
+
     BOOST_CHECK(fi.is_ready());
 }
 
 void test_destroying_a_promise_stores_broken_promise()
 {
+ LOG;
     boost::unique_future<int> f;
-
+
     {
         boost::promise<int> p;
- f=p.get_future();
+ f=BOOST_THREAD_MAKE_RV_REF(p.get_future());
     }
     BOOST_CHECK(f.is_ready());
     BOOST_CHECK(f.has_exception());
@@ -675,11 +719,12 @@
 
 void test_destroying_a_packaged_task_stores_broken_promise()
 {
+ LOG;
     boost::unique_future<int> f;
-
+
     {
         boost::packaged_task<int> p(make_int);
- f=p.get_future();
+ f=BOOST_THREAD_MAKE_RV_REF(p.get_future());
     }
     BOOST_CHECK(f.is_ready());
     BOOST_CHECK(f.has_exception());
@@ -700,15 +745,16 @@
 
 void test_wait_for_either_of_two_futures_1()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
-
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
+
     boost::thread(::cast_to_rval(pt));
-
+
     unsigned const future=boost::wait_for_any(f1,f2);
-
+
     BOOST_CHECK(future==0);
     BOOST_CHECK(f1.is_ready());
     BOOST_CHECK(!f2.is_ready());
@@ -717,15 +763,16 @@
 
 void test_wait_for_either_of_two_futures_2()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
-
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
+
     boost::thread(::cast_to_rval(pt2));
-
+
     unsigned const future=boost::wait_for_any(f1,f2);
-
+
     BOOST_CHECK(future==1);
     BOOST_CHECK(!f1.is_ready());
     BOOST_CHECK(f2.is_ready());
@@ -734,17 +781,18 @@
 
 void test_wait_for_either_of_three_futures_1()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
     boost::packaged_task<int> pt3(make_int_slowly);
- boost::unique_future<int> f3(pt3.get_future());
-
+ boost::unique_future<int> f3(BOOST_THREAD_MAKE_RV_REF(pt3.get_future()));
+
     boost::thread(::cast_to_rval(pt));
-
+
     unsigned const future=boost::wait_for_any(f1,f2,f3);
-
+
     BOOST_CHECK(future==0);
     BOOST_CHECK(f1.is_ready());
     BOOST_CHECK(!f2.is_ready());
@@ -754,17 +802,18 @@
 
 void test_wait_for_either_of_three_futures_2()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
     boost::packaged_task<int> pt3(make_int_slowly);
- boost::unique_future<int> f3(pt3.get_future());
-
+ boost::unique_future<int> f3(BOOST_THREAD_MAKE_RV_REF(pt3.get_future()));
+
     boost::thread(::cast_to_rval(pt2));
-
+
     unsigned const future=boost::wait_for_any(f1,f2,f3);
-
+
     BOOST_CHECK(future==1);
     BOOST_CHECK(!f1.is_ready());
     BOOST_CHECK(f2.is_ready());
@@ -774,17 +823,18 @@
 
 void test_wait_for_either_of_three_futures_3()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
     boost::packaged_task<int> pt3(make_int_slowly);
- boost::unique_future<int> f3(pt3.get_future());
-
+ boost::unique_future<int> f3(BOOST_THREAD_MAKE_RV_REF(pt3.get_future()));
+
     boost::thread(::cast_to_rval(pt3));
-
+
     unsigned const future=boost::wait_for_any(f1,f2,f3);
-
+
     BOOST_CHECK(future==2);
     BOOST_CHECK(!f1.is_ready());
     BOOST_CHECK(!f2.is_ready());
@@ -794,19 +844,20 @@
 
 void test_wait_for_either_of_four_futures_1()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
     boost::packaged_task<int> pt3(make_int_slowly);
- boost::unique_future<int> f3(pt3.get_future());
+ boost::unique_future<int> f3(BOOST_THREAD_MAKE_RV_REF(pt3.get_future()));
     boost::packaged_task<int> pt4(make_int_slowly);
- boost::unique_future<int> f4(pt4.get_future());
-
+ boost::unique_future<int> f4(BOOST_THREAD_MAKE_RV_REF(pt4.get_future()));
+
     boost::thread(::cast_to_rval(pt));
-
+
     unsigned const future=boost::wait_for_any(f1,f2,f3,f4);
-
+
     BOOST_CHECK(future==0);
     BOOST_CHECK(f1.is_ready());
     BOOST_CHECK(!f2.is_ready());
@@ -817,19 +868,20 @@
 
 void test_wait_for_either_of_four_futures_2()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
     boost::packaged_task<int> pt3(make_int_slowly);
- boost::unique_future<int> f3(pt3.get_future());
+ boost::unique_future<int> f3(BOOST_THREAD_MAKE_RV_REF(pt3.get_future()));
     boost::packaged_task<int> pt4(make_int_slowly);
- boost::unique_future<int> f4(pt4.get_future());
-
+ boost::unique_future<int> f4(BOOST_THREAD_MAKE_RV_REF(pt4.get_future()));
+
     boost::thread(::cast_to_rval(pt2));
-
+
     unsigned const future=boost::wait_for_any(f1,f2,f3,f4);
-
+
     BOOST_CHECK(future==1);
     BOOST_CHECK(!f1.is_ready());
     BOOST_CHECK(f2.is_ready());
@@ -840,19 +892,20 @@
 
 void test_wait_for_either_of_four_futures_3()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
     boost::packaged_task<int> pt3(make_int_slowly);
- boost::unique_future<int> f3(pt3.get_future());
+ boost::unique_future<int> f3(BOOST_THREAD_MAKE_RV_REF(pt3.get_future()));
     boost::packaged_task<int> pt4(make_int_slowly);
- boost::unique_future<int> f4(pt4.get_future());
-
+ boost::unique_future<int> f4(BOOST_THREAD_MAKE_RV_REF(pt4.get_future()));
+
     boost::thread(::cast_to_rval(pt3));
-
+
     unsigned const future=boost::wait_for_any(f1,f2,f3,f4);
-
+
     BOOST_CHECK(future==2);
     BOOST_CHECK(!f1.is_ready());
     BOOST_CHECK(!f2.is_ready());
@@ -863,19 +916,20 @@
 
 void test_wait_for_either_of_four_futures_4()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
     boost::packaged_task<int> pt3(make_int_slowly);
- boost::unique_future<int> f3(pt3.get_future());
+ boost::unique_future<int> f3(BOOST_THREAD_MAKE_RV_REF(pt3.get_future()));
     boost::packaged_task<int> pt4(make_int_slowly);
- boost::unique_future<int> f4(pt4.get_future());
-
+ boost::unique_future<int> f4(BOOST_THREAD_MAKE_RV_REF(pt4.get_future()));
+
     boost::thread(::cast_to_rval(pt4));
-
+
     unsigned const future=boost::wait_for_any(f1,f2,f3,f4);
-
+
     BOOST_CHECK(future==3);
     BOOST_CHECK(!f1.is_ready());
     BOOST_CHECK(!f2.is_ready());
@@ -886,21 +940,22 @@
 
 void test_wait_for_either_of_five_futures_1()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
     boost::packaged_task<int> pt3(make_int_slowly);
- boost::unique_future<int> f3(pt3.get_future());
+ boost::unique_future<int> f3(BOOST_THREAD_MAKE_RV_REF(pt3.get_future()));
     boost::packaged_task<int> pt4(make_int_slowly);
- boost::unique_future<int> f4(pt4.get_future());
+ boost::unique_future<int> f4(BOOST_THREAD_MAKE_RV_REF(pt4.get_future()));
     boost::packaged_task<int> pt5(make_int_slowly);
- boost::unique_future<int> f5(pt5.get_future());
-
+ boost::unique_future<int> f5(BOOST_THREAD_MAKE_RV_REF(pt5.get_future()));
+
     boost::thread(::cast_to_rval(pt));
-
+
     unsigned const future=boost::wait_for_any(f1,f2,f3,f4,f5);
-
+
     BOOST_CHECK(future==0);
     BOOST_CHECK(f1.is_ready());
     BOOST_CHECK(!f2.is_ready());
@@ -912,21 +967,22 @@
 
 void test_wait_for_either_of_five_futures_2()
 {
- boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ LOG;
+ boost::packaged_task<int> pt(make_int_slowly);
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
     boost::packaged_task<int> pt3(make_int_slowly);
- boost::unique_future<int> f3(pt3.get_future());
+ boost::unique_future<int> f3(BOOST_THREAD_MAKE_RV_REF(pt3.get_future()));
     boost::packaged_task<int> pt4(make_int_slowly);
- boost::unique_future<int> f4(pt4.get_future());
+ boost::unique_future<int> f4(BOOST_THREAD_MAKE_RV_REF(pt4.get_future()));
     boost::packaged_task<int> pt5(make_int_slowly);
- boost::unique_future<int> f5(pt5.get_future());
-
+ boost::unique_future<int> f5(BOOST_THREAD_MAKE_RV_REF(pt5.get_future()));
+
     boost::thread(::cast_to_rval(pt2));
-
+
     unsigned const future=boost::wait_for_any(f1,f2,f3,f4,f5);
-
+
     BOOST_CHECK(future==1);
     BOOST_CHECK(!f1.is_ready());
     BOOST_CHECK(f2.is_ready());
@@ -937,21 +993,22 @@
 }
 void test_wait_for_either_of_five_futures_3()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
     boost::packaged_task<int> pt3(make_int_slowly);
- boost::unique_future<int> f3(pt3.get_future());
+ boost::unique_future<int> f3(BOOST_THREAD_MAKE_RV_REF(pt3.get_future()));
     boost::packaged_task<int> pt4(make_int_slowly);
- boost::unique_future<int> f4(pt4.get_future());
+ boost::unique_future<int> f4(BOOST_THREAD_MAKE_RV_REF(pt4.get_future()));
     boost::packaged_task<int> pt5(make_int_slowly);
- boost::unique_future<int> f5(pt5.get_future());
-
+ boost::unique_future<int> f5(BOOST_THREAD_MAKE_RV_REF(pt5.get_future()));
+
     boost::thread(::cast_to_rval(pt3));
-
+
     unsigned const future=boost::wait_for_any(f1,f2,f3,f4,f5);
-
+
     BOOST_CHECK(future==2);
     BOOST_CHECK(!f1.is_ready());
     BOOST_CHECK(!f2.is_ready());
@@ -962,21 +1019,22 @@
 }
 void test_wait_for_either_of_five_futures_4()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
     boost::packaged_task<int> pt3(make_int_slowly);
- boost::unique_future<int> f3(pt3.get_future());
+ boost::unique_future<int> f3(BOOST_THREAD_MAKE_RV_REF(pt3.get_future()));
     boost::packaged_task<int> pt4(make_int_slowly);
- boost::unique_future<int> f4(pt4.get_future());
+ boost::unique_future<int> f4(BOOST_THREAD_MAKE_RV_REF(pt4.get_future()));
     boost::packaged_task<int> pt5(make_int_slowly);
- boost::unique_future<int> f5(pt5.get_future());
-
+ boost::unique_future<int> f5(BOOST_THREAD_MAKE_RV_REF(pt5.get_future()));
+
     boost::thread(::cast_to_rval(pt4));
-
+
     unsigned const future=boost::wait_for_any(f1,f2,f3,f4,f5);
-
+
     BOOST_CHECK(future==3);
     BOOST_CHECK(!f1.is_ready());
     BOOST_CHECK(!f2.is_ready());
@@ -987,21 +1045,22 @@
 }
 void test_wait_for_either_of_five_futures_5()
 {
+ LOG;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> f1(pt.get_future());
+ boost::unique_future<int> f1(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> f2(pt2.get_future());
+ boost::unique_future<int> f2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
     boost::packaged_task<int> pt3(make_int_slowly);
- boost::unique_future<int> f3(pt3.get_future());
+ boost::unique_future<int> f3(BOOST_THREAD_MAKE_RV_REF(pt3.get_future()));
     boost::packaged_task<int> pt4(make_int_slowly);
- boost::unique_future<int> f4(pt4.get_future());
+ boost::unique_future<int> f4(BOOST_THREAD_MAKE_RV_REF(pt4.get_future()));
     boost::packaged_task<int> pt5(make_int_slowly);
- boost::unique_future<int> f5(pt5.get_future());
-
+ boost::unique_future<int> f5(BOOST_THREAD_MAKE_RV_REF(pt5.get_future()));
+
     boost::thread(::cast_to_rval(pt5));
-
+
     unsigned const future=boost::wait_for_any(f1,f2,f3,f4,f5);
-
+
     BOOST_CHECK(future==4);
     BOOST_CHECK(!f1.is_ready());
     BOOST_CHECK(!f2.is_ready());
@@ -1013,15 +1072,16 @@
 
 void test_wait_for_either_invokes_callbacks()
 {
+ LOG;
     callback_called=0;
     boost::packaged_task<int> pt(make_int_slowly);
- boost::unique_future<int> fi=pt.get_future();
+ boost::unique_future<int> fi(BOOST_THREAD_MAKE_RV_REF(pt.get_future()));
     boost::packaged_task<int> pt2(make_int_slowly);
- boost::unique_future<int> fi2=pt2.get_future();
+ boost::unique_future<int> fi2(BOOST_THREAD_MAKE_RV_REF(pt2.get_future()));
     pt.set_wait_callback(wait_callback_for_task);
 
     boost::thread(::cast_to_rval(pt));
-
+
     boost::wait_for_any(fi,fi2);
     BOOST_CHECK(callback_called==1);
     BOOST_CHECK(fi.get()==42);
@@ -1029,6 +1089,7 @@
 
 void test_wait_for_any_from_range()
 {
+ LOG;
     unsigned const count=10;
     for(unsigned i=0;i<count;++i)
     {
@@ -1037,14 +1098,14 @@
         for(unsigned j=0;j<count;++j)
         {
             tasks[j]=boost::packaged_task<int>(make_int_slowly);
- futures[j]=tasks[j].get_future();
+ futures[j]=BOOST_THREAD_MAKE_RV_REF(tasks[j].get_future());
         }
         boost::thread(::cast_to_rval(tasks[i]));
-
+
         BOOST_CHECK(boost::wait_for_any(futures,futures)==futures);
-
+
         boost::unique_future<int>* const future=boost::wait_for_any(futures,futures+count);
-
+
         BOOST_CHECK(future==(futures+i));
         for(unsigned j=0;j<count;++j)
         {
@@ -1063,17 +1124,18 @@
 
 void test_wait_for_all_from_range()
 {
+ LOG;
     unsigned const count=10;
     boost::unique_future<int> futures[count];
     for(unsigned j=0;j<count;++j)
     {
         boost::packaged_task<int> task(make_int_slowly);
- futures[j]=task.get_future();
+ futures[j]=BOOST_THREAD_MAKE_RV_REF(task.get_future());
         boost::thread(::cast_to_rval(task));
     }
-
+
     boost::wait_for_all(futures,futures+count);
-
+
     for(unsigned j=0;j<count;++j)
     {
         BOOST_CHECK(futures[j].is_ready());
@@ -1082,17 +1144,18 @@
 
 void test_wait_for_all_two_futures()
 {
+ LOG;
     unsigned const count=2;
     boost::unique_future<int> futures[count];
     for(unsigned j=0;j<count;++j)
     {
         boost::packaged_task<int> task(make_int_slowly);
- futures[j]=task.get_future();
+ futures[j]=BOOST_THREAD_MAKE_RV_REF(task.get_future());
         boost::thread(::cast_to_rval(task));
     }
-
+
     boost::wait_for_all(futures[0],futures[1]);
-
+
     for(unsigned j=0;j<count;++j)
     {
         BOOST_CHECK(futures[j].is_ready());
@@ -1101,17 +1164,18 @@
 
 void test_wait_for_all_three_futures()
 {
+ LOG;
     unsigned const count=3;
     boost::unique_future<int> futures[count];
     for(unsigned j=0;j<count;++j)
     {
         boost::packaged_task<int> task(make_int_slowly);
- futures[j]=task.get_future();
+ futures[j]=BOOST_THREAD_MAKE_RV_REF(task.get_future());
         boost::thread(::cast_to_rval(task));
     }
-
+
     boost::wait_for_all(futures[0],futures[1],futures[2]);
-
+
     for(unsigned j=0;j<count;++j)
     {
         BOOST_CHECK(futures[j].is_ready());
@@ -1120,17 +1184,18 @@
 
 void test_wait_for_all_four_futures()
 {
+ LOG;
     unsigned const count=4;
     boost::unique_future<int> futures[count];
     for(unsigned j=0;j<count;++j)
     {
         boost::packaged_task<int> task(make_int_slowly);
- futures[j]=task.get_future();
+ futures[j]=BOOST_THREAD_MAKE_RV_REF(task.get_future());
         boost::thread(::cast_to_rval(task));
     }
-
+
     boost::wait_for_all(futures[0],futures[1],futures[2],futures[3]);
-
+
     for(unsigned j=0;j<count;++j)
     {
         BOOST_CHECK(futures[j].is_ready());
@@ -1139,17 +1204,18 @@
 
 void test_wait_for_all_five_futures()
 {
+ LOG;
     unsigned const count=5;
     boost::unique_future<int> futures[count];
     for(unsigned j=0;j<count;++j)
     {
         boost::packaged_task<int> task(make_int_slowly);
- futures[j]=task.get_future();
+ futures[j]=BOOST_THREAD_MAKE_RV_REF(task.get_future());
         boost::thread(::cast_to_rval(task));
     }
-
+
     boost::wait_for_all(futures[0],futures[1],futures[2],futures[3],futures[4]);
-
+
     for(unsigned j=0;j<count;++j)
     {
         BOOST_CHECK(futures[j].is_ready());
@@ -1218,3 +1284,16 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_generic_locks.cpp
==============================================================================
--- branches/release/libs/thread/test/test_generic_locks.cpp (original)
+++ branches/release/libs/thread/test/test_generic_locks.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -18,9 +18,9 @@
 
     BOOST_CHECK(!l1.owns_lock());
     BOOST_CHECK(!l2.owns_lock());
-
+
     boost::lock(l1,l2);
-
+
     BOOST_CHECK(l1.owns_lock());
     BOOST_CHECK(l2.owns_lock());
 }
@@ -30,11 +30,11 @@
     boost::mutex m;
     bool flag;
     boost::condition_variable cond;
-
+
     wait_data():
         flag(false)
     {}
-
+
     void wait()
     {
         boost::mutex::scoped_lock l(m);
@@ -48,7 +48,7 @@
     bool timed_wait(Duration d)
     {
         boost::system_time const target=boost::get_system_time()+d;
-
+
         boost::mutex::scoped_lock l(m);
         while(!flag)
         {
@@ -59,7 +59,7 @@
         }
         return true;
     }
-
+
     void signal()
     {
         boost::mutex::scoped_lock l(m);
@@ -67,7 +67,7 @@
         cond.notify_all();
     }
 };
-
+
 
 void lock_mutexes_slowly(boost::mutex* m1,boost::mutex* m2,wait_data* locked,wait_data* quit)
 {
@@ -90,7 +90,7 @@
     boost::mutex m1,m2;
     wait_data locked;
     wait_data release;
-
+
     boost::thread t(lock_mutexes_slowly,&m1,&m2,&locked,&release);
     boost::this_thread::sleep(boost::posix_time::milliseconds(10));
 
@@ -98,7 +98,7 @@
     BOOST_CHECK(locked.timed_wait(boost::posix_time::seconds(1)));
 
     release.signal();
-
+
     BOOST_CHECK(t2.timed_join(boost::posix_time::seconds(1)));
 
     t.join();
@@ -109,7 +109,7 @@
     boost::mutex m1,m2;
     wait_data locked;
     wait_data release;
-
+
     boost::thread t(lock_mutexes_slowly,&m1,&m2,&locked,&release);
     boost::this_thread::sleep(boost::posix_time::milliseconds(10));
 
@@ -117,7 +117,7 @@
     BOOST_CHECK(locked.timed_wait(boost::posix_time::seconds(1)));
 
     release.signal();
-
+
     BOOST_CHECK(t2.timed_join(boost::posix_time::seconds(1)));
 
     t.join();
@@ -138,9 +138,9 @@
     BOOST_CHECK(!l3.owns_lock());
     BOOST_CHECK(!l4.owns_lock());
     BOOST_CHECK(!l5.owns_lock());
-
+
     boost::lock(l1,l2,l3,l4,l5);
-
+
     BOOST_CHECK(l1.owns_lock());
     BOOST_CHECK(l2.owns_lock());
     BOOST_CHECK(l3.owns_lock());
@@ -179,7 +179,7 @@
     boost::mutex m1,m2,m3,m4,m5;
     wait_data locked;
     wait_data release;
-
+
     boost::thread t(lock_five_mutexes_slowly,&m1,&m2,&m3,&m4,&m5,&locked,&release);
     boost::this_thread::sleep(boost::posix_time::milliseconds(10));
 
@@ -187,7 +187,7 @@
     BOOST_CHECK(locked.timed_wait(boost::posix_time::seconds(3)));
 
     release.signal();
-
+
     BOOST_CHECK(t2.timed_join(boost::posix_time::seconds(3)));
 
     t.join();
@@ -198,7 +198,7 @@
     boost::mutex m1,m2,m3,m4,m5;
     wait_data locked;
     wait_data release;
-
+
     boost::thread t(lock_five_mutexes_slowly,&m1,&m2,&m3,&m4,&m5,&locked,&release);
     boost::this_thread::sleep(boost::posix_time::milliseconds(10));
 
@@ -206,7 +206,7 @@
     BOOST_CHECK(locked.timed_wait(boost::posix_time::seconds(3)));
 
     release.signal();
-
+
     BOOST_CHECK(t2.timed_join(boost::posix_time::seconds(3)));
 
     t.join();
@@ -225,11 +225,11 @@
 void test_lock_ten_other_thread_locks_in_different_order()
 {
     unsigned const num_mutexes=10;
-
+
     boost::mutex mutexes[num_mutexes];
     wait_data locked;
     wait_data release;
-
+
     boost::thread t(lock_five_mutexes_slowly,&mutexes[6],&mutexes[3],&mutexes[8],&mutexes[0],&mutexes[2],&locked,&release);
     boost::this_thread::sleep(boost::posix_time::milliseconds(10));
 
@@ -246,16 +246,16 @@
 struct dummy_mutex
 {
     bool is_locked;
-
+
     dummy_mutex():
         is_locked(false)
     {}
-
+
     void lock()
     {
         is_locked=true;
     }
-
+
     bool try_lock()
     {
         if(is_locked)
@@ -265,7 +265,7 @@
         is_locked=true;
         return true;
     }
-
+
     void unlock()
     {
         is_locked=false;
@@ -289,7 +289,7 @@
     dummy_mutex mutexes[num_mutexes];
 
     boost::lock(mutexes,mutexes+num_mutexes);
-
+
     for(unsigned i=0;i<num_mutexes;++i)
     {
         BOOST_CHECK(mutexes[i].is_locked);
@@ -306,7 +306,7 @@
     explicit dummy_iterator(dummy_mutex* p_):
         p(p_)
     {}
-
+
     bool operator==(dummy_iterator const& other) const
     {
         return p==other.p;
@@ -321,7 +321,7 @@
     {
         return p<other.p;
     }
-
+
     dummy_mutex& operator*() const
     {
         return *p;
@@ -331,22 +331,22 @@
     {
         return p;
     }
-
+
     dummy_iterator operator++(int)
     {
         dummy_iterator temp(*this);
         ++p;
         return temp;
     }
-
+
     dummy_iterator& operator++()
     {
         ++p;
         return *this;
     }
-
+
 };
-
+
 
 void test_lock_five_in_range_custom_iterator()
 {
@@ -354,7 +354,7 @@
     dummy_mutex mutexes[num_mutexes];
 
     boost::lock(dummy_iterator(mutexes),dummy_iterator(mutexes+num_mutexes));
-
+
     for(unsigned i=0;i<num_mutexes;++i)
     {
         BOOST_CHECK(mutexes[i].is_locked);
@@ -372,7 +372,7 @@
     dummy_mutex2 mutexes[num_mutexes];
 
     boost::lock(mutexes,mutexes+num_mutexes);
-
+
     for(unsigned i=0;i<num_mutexes;++i)
     {
         BOOST_CHECK(mutexes[i].is_locked);
@@ -384,7 +384,7 @@
     dummy_mutex m1,m2;
 
     int const res=boost::try_lock(m1,m2);
-
+
     BOOST_CHECK(res==-1);
     BOOST_CHECK(m1.is_locked);
     BOOST_CHECK(m2.is_locked);
@@ -398,7 +398,7 @@
         l2(m2,boost::defer_lock);
 
     int const res=boost::try_lock(l1,l2);
-
+
     BOOST_CHECK(res==0);
     BOOST_CHECK(m1.is_locked);
     BOOST_CHECK(!m2.is_locked);
@@ -414,7 +414,7 @@
         l2(m2,boost::defer_lock);
 
     int const res=boost::try_lock(l1,l2);
-
+
     BOOST_CHECK(res==1);
     BOOST_CHECK(!m1.is_locked);
     BOOST_CHECK(m2.is_locked);
@@ -425,7 +425,7 @@
 void test_try_lock_three()
 {
     int const num_mutexes=3;
-
+
     for(int i=-1;i<num_mutexes;++i)
     {
         dummy_mutex mutexes[num_mutexes];
@@ -439,7 +439,7 @@
             l3(mutexes[2],boost::defer_lock);
 
         int const res=boost::try_lock(l1,l2,l3);
-
+
         BOOST_CHECK(res==i);
         for(int j=0;j<num_mutexes;++j)
         {
@@ -470,7 +470,7 @@
 void test_try_lock_four()
 {
     int const num_mutexes=4;
-
+
     for(int i=-1;i<num_mutexes;++i)
     {
         dummy_mutex mutexes[num_mutexes];
@@ -485,7 +485,7 @@
             l4(mutexes[3],boost::defer_lock);
 
         int const res=boost::try_lock(l1,l2,l3,l4);
-
+
         BOOST_CHECK(res==i);
         for(int j=0;j<num_mutexes;++j)
         {
@@ -518,7 +518,7 @@
 void test_try_lock_five()
 {
     int const num_mutexes=5;
-
+
     for(int i=-1;i<num_mutexes;++i)
     {
         dummy_mutex mutexes[num_mutexes];
@@ -534,7 +534,7 @@
             l5(mutexes[4],boost::defer_lock);
 
         int const res=boost::try_lock(l1,l2,l3,l4,l5);
-
+
         BOOST_CHECK(res==i);
         for(int j=0;j<num_mutexes;++j)
         {
@@ -592,3 +592,16 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_hardware_concurrency.cpp
==============================================================================
--- branches/release/libs/thread/test/test_hardware_concurrency.cpp (original)
+++ branches/release/libs/thread/test/test_hardware_concurrency.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,6 +1,6 @@
 // Copyright (C) 2007 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/thread.hpp>
 #include <boost/test/unit_test.hpp>
@@ -19,3 +19,16 @@
     test->add(BOOST_TEST_CASE(test_hardware_concurrency_is_non_zero));
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_lock_concept.cpp
==============================================================================
--- branches/release/libs/thread/test/test_lock_concept.cpp (original)
+++ branches/release/libs/thread/test/test_lock_concept.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -18,7 +18,7 @@
     {
         Mutex m;
         Lock lock(m);
-
+
         BOOST_CHECK(lock);
         BOOST_CHECK(lock.owns_lock());
     }
@@ -32,7 +32,7 @@
     bool done;
     bool locked;
     boost::condition_variable done_cond;
-
+
     test_initially_unlocked_if_other_thread_has_lock():
         done(false),locked(false)
     {}
@@ -51,7 +51,7 @@
     {
         return done;
     }
-
+
 
     void operator()()
     {
@@ -69,7 +69,7 @@
                                                  boost::bind(&this_type::is_done,this)));
                 BOOST_CHECK(!locked);
             }
-
+
             lock.unlock();
             t.join();
         }
@@ -90,7 +90,7 @@
     bool done;
     bool locked;
     boost::condition_variable done_cond;
-
+
     test_initially_unlocked_with_try_lock_if_other_thread_has_unique_lock():
         done(false),locked(false)
     {}
@@ -109,7 +109,7 @@
     {
         return done;
     }
-
+
 
     void operator()()
     {
@@ -127,7 +127,7 @@
                                                  boost::bind(&this_type::is_done,this)));
                 BOOST_CHECK(!locked);
             }
-
+
             lock.unlock();
             t.join();
         }
@@ -148,7 +148,7 @@
     bool done;
     bool locked;
     boost::condition_variable done_cond;
-
+
     test_initially_locked_if_other_thread_has_shared_lock():
         done(false),locked(false)
     {}
@@ -167,7 +167,7 @@
     {
         return done;
     }
-
+
 
     void operator()()
     {
@@ -185,7 +185,7 @@
                                                  boost::bind(&this_type::is_done,this)));
                 BOOST_CHECK(locked);
             }
-
+
             lock.unlock();
             t.join();
         }
@@ -205,7 +205,7 @@
     {
         Mutex m;
         Lock lock(m,boost::defer_lock);
-
+
         BOOST_CHECK(!lock);
         BOOST_CHECK(!lock.owns_lock());
     }
@@ -219,7 +219,7 @@
         Mutex m;
         m.lock();
         Lock lock(m,boost::adopt_lock);
-
+
         BOOST_CHECK(lock);
         BOOST_CHECK(lock.owns_lock());
     }
@@ -273,7 +273,7 @@
     bool done;
     bool locked;
     boost::condition_variable done_cond;
-
+
     test_unlocked_after_try_lock_if_other_thread_has_lock():
         done(false),locked(false)
     {}
@@ -292,7 +292,7 @@
     {
         return done;
     }
-
+
 
     void operator()()
     {
@@ -310,7 +310,7 @@
                                                  boost::bind(&this_type::is_done,this)));
                 BOOST_CHECK(!locked);
             }
-
+
             lock.unlock();
             t.join();
         }
@@ -330,7 +330,7 @@
     {
         Mutex m;
         Lock lock(m);
-
+
         BOOST_CHECK_THROW( lock.lock(), boost::lock_error );
     }
 };
@@ -342,7 +342,7 @@
     {
         Mutex m;
         Lock lock(m);
-
+
         BOOST_CHECK_THROW( lock.try_lock(), boost::lock_error );
     }
 };
@@ -355,7 +355,7 @@
         Mutex m;
         Lock lock(m);
         lock.unlock();
-
+
         BOOST_CHECK_THROW( lock.unlock(), boost::lock_error );
     }
 };
@@ -367,7 +367,7 @@
         Lock l;
         BOOST_CHECK(!l.mutex());
         BOOST_CHECK(!l.owns_lock());
- };
+ }
 };
 
 
@@ -387,18 +387,21 @@
         BOOST_CHECK_EQUAL(l2.mutex(),&m2);
 
         l1.swap(l2);
-
+
         BOOST_CHECK_EQUAL(l1.mutex(),&m2);
         BOOST_CHECK_EQUAL(l2.mutex(),&m1);
-
+
         swap(l1,l2);
 
         BOOST_CHECK_EQUAL(l1.mutex(),&m1);
         BOOST_CHECK_EQUAL(l2.mutex(),&m2);
 
+#if 0
         l1.swap(Lock(m3));
 
         BOOST_CHECK_EQUAL(l1.mutex(),&m3);
+#endif
+
     }
 };
 
@@ -437,7 +440,7 @@
 BOOST_TEST_CASE_TEMPLATE_FUNCTION(test_scoped_try_lock_concept,Mutex)
 {
     typedef typename Mutex::scoped_try_lock Lock;
-
+
     test_default_constructed_has_no_mutex_and_unlocked<Lock>()();
     test_initially_locked<Mutex,Lock>()();
     test_initially_unlocked_if_other_thread_has_lock<Mutex,Lock>()();
@@ -470,25 +473,25 @@
         timed_locked_relative(false),
         timed_locked_absolute(false)
     {}
-
+
     void lock()
     {
         locked=true;
     }
-
+
     void lock_shared()
     {
         shared_locked=true;
     }
-
+
     void unlock()
     {}
-
+
     void unlock_shared()
     {
         shared_unlocked=true;
     }
-
+
     bool timed_lock_shared(boost::system_time)
     {
         shared_timed_locked_absolute=true;
@@ -511,7 +514,7 @@
         timed_locked_relative=true;
         return false;
     }
-
+
 };
 
 
@@ -519,7 +522,7 @@
 {
     typedef boost::shared_mutex Mutex;
     typedef boost::shared_lock<Mutex> Lock;
-
+
     test_default_constructed_has_no_mutex_and_unlocked<Lock>()();
     test_initially_locked<Mutex,Lock>()();
     test_initially_unlocked_with_try_lock_if_other_thread_has_unique_lock<Mutex,Lock>()();
@@ -552,7 +555,7 @@
 
     typedef boost::mpl::vector<boost::mutex,boost::try_mutex,boost::timed_mutex,
         boost::recursive_mutex,boost::recursive_try_mutex,boost::recursive_timed_mutex> mutex_types_with_scoped_lock;
-
+
     test->add(BOOST_TEST_CASE_TEMPLATE(test_scoped_lock_concept,mutex_types_with_scoped_lock));
 
     typedef boost::mpl::vector<boost::try_mutex,boost::timed_mutex,
@@ -562,9 +565,22 @@
 
     typedef boost::mpl::vector<boost::mutex,boost::try_mutex,boost::timed_mutex,
         boost::recursive_mutex,boost::recursive_try_mutex,boost::recursive_timed_mutex,boost::shared_mutex> all_mutex_types;
-
+
     test->add(BOOST_TEST_CASE_TEMPLATE(test_unique_lock_is_scoped_lock,all_mutex_types));
     test->add(BOOST_TEST_CASE(&test_shared_lock));
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_move_function.cpp
==============================================================================
--- branches/release/libs/thread/test/test_move_function.cpp (original)
+++ branches/release/libs/thread/test/test_move_function.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -47,7 +47,8 @@
 
 void test_thread_move_from_rvalue_using_explicit_move()
 {
- boost::thread x(boost::move(start_thread()));
+ //boost::thread x(boost::move(start_thread()));
+ boost::thread x=start_thread();
     BOOST_CHECK(x.get_id()!=boost::thread::id());
     x.join();
 }
@@ -108,15 +109,10 @@
     };
 }
 
-#ifdef BOOST_NO_RVALUE_REFERENCES
 namespace boost
 {
- template <>
- struct has_move_emulation_enabled_aux<user_test_ns::nc>
- : BOOST_MOVE_BOOST_NS::integral_constant<bool, true>
- {};
+ BOOST_THREAD_DCL_MOVABLE(user_test_ns::nc)
 }
-#endif
 
 void test_move_for_user_defined_type_unaffected()
 {
@@ -143,3 +139,16 @@
     test->add(BOOST_TEST_CASE(test_move_for_user_defined_type_unaffected));
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_mutex.cpp
==============================================================================
--- branches/release/libs/thread/test/test_mutex.cpp (original)
+++ branches/release/libs/thread/test/test_mutex.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,7 +1,7 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/detail/config.hpp>
@@ -101,13 +101,13 @@
 struct test_lock_times_out_if_other_thread_has_lock
 {
     typedef boost::unique_lock<Mutex> Lock;
-
+
     Mutex m;
     boost::mutex done_mutex;
     bool done;
     bool locked;
     boost::condition_variable done_cond;
-
+
     test_lock_times_out_if_other_thread_has_lock():
         done(false),locked(false)
     {}
@@ -139,14 +139,14 @@
     }
 
     typedef test_lock_times_out_if_other_thread_has_lock<Mutex> this_type;
-
+
     void do_test(void (this_type::*test_func)())
     {
         Lock lock(m);
 
         locked=false;
         done=false;
-
+
         boost::thread t(test_func,this);
 
         try
@@ -157,7 +157,7 @@
                                                  boost::bind(&this_type::is_done,this)));
                 BOOST_CHECK(!locked);
             }
-
+
             lock.unlock();
             t.join();
         }
@@ -168,7 +168,7 @@
             throw;
         }
     }
-
+
 
     void operator()()
     {
@@ -191,7 +191,7 @@
     void operator()()
     {
         test_lock_times_out_if_other_thread_has_lock<mutex_type>()();
-
+
         mutex_type mutex;
         boost::condition condition;
 
@@ -243,7 +243,7 @@
         BOOST_CHECK(lock ? true : false);
         lock.unlock();
         BOOST_CHECK(!lock);
-
+
     }
 };
 
@@ -345,3 +345,16 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_once.cpp
==============================================================================
--- branches/release/libs/thread/test/test_once.cpp (original)
+++ branches/release/libs/thread/test/test_once.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -8,6 +8,9 @@
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/once.hpp>
 
+#define LOG \
+ if (false) {} else std::cout << std::endl << __FILE__ << "[" << __LINE__ << "]"
+
 boost::once_flag flag=BOOST_ONCE_INIT;
 int var_to_init=0;
 boost::mutex m;
@@ -39,6 +42,8 @@
 
 void test_call_once()
 {
+ LOG;
+
     unsigned const num_threads=20;
     boost::thread_group group;
 
@@ -68,7 +73,7 @@
     explicit increment_value(int* value_):
         value(value_)
     {}
-
+
     void operator()() const
     {
         boost::mutex::scoped_lock lock(m);
@@ -96,6 +101,8 @@
 
 void test_call_once_arbitrary_functor()
 {
+ LOG;
+
     unsigned const num_threads=20;
     boost::thread_group group;
 
@@ -124,7 +131,7 @@
     {};
 
     static unsigned pass_counter;
-
+
     void operator()() const
     {
         boost::mutex::scoped_lock lock(m);
@@ -155,6 +162,7 @@
 
 void test_call_once_retried_on_exception()
 {
+ LOG;
     unsigned const num_threads=20;
     boost::thread_group group;
 
@@ -189,3 +197,16 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_shared_mutex.cpp
==============================================================================
--- branches/release/libs/thread/test/test_shared_mutex.cpp (original)
+++ branches/release/libs/thread/test/test_shared_mutex.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -18,7 +18,7 @@
 void test_multiple_readers()
 {
     unsigned const number_of_threads=10;
-
+
     boost::thread_group pool;
 
     boost::shared_mutex rw_mutex;
@@ -65,7 +65,7 @@
 void test_only_one_writer_permitted()
 {
     unsigned const number_of_threads=10;
-
+
     boost::thread_group pool;
 
     boost::shared_mutex rw_mutex;
@@ -76,7 +76,7 @@
     boost::condition_variable unblocked_condition;
     boost::mutex finish_mutex;
     boost::mutex::scoped_lock finish_lock(finish_mutex);
-
+
     try
     {
         for(unsigned i=0;i<number_of_threads;++i)
@@ -116,10 +116,10 @@
     boost::condition_variable unblocked_condition;
     boost::mutex finish_mutex;
     boost::mutex::scoped_lock finish_lock(finish_mutex);
-
+
     try
     {
-
+
         pool.create_thread(locking_thread<boost::shared_lock<boost::shared_mutex> >(rw_mutex,unblocked_count,unblocked_count_mutex,unblocked_condition,
                                                                                     finish_mutex,simultaneous_running_count,max_simultaneous_running));
         {
@@ -177,7 +177,7 @@
         CHECK_LOCKED_VALUE_EQUAL(unblocked_count_mutex,unblocked_count,0U);
 
         write_lock.unlock();
-
+
         {
             boost::mutex::scoped_lock lk(unblocked_count_mutex);
             while(unblocked_count<reader_count)
@@ -283,3 +283,16 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_shared_mutex_part_2.cpp
==============================================================================
--- branches/release/libs/thread/test/test_shared_mutex_part_2.cpp (original)
+++ branches/release/libs/thread/test/test_shared_mutex_part_2.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -21,9 +21,9 @@
     boost::mutex& finish_mutex;
     boost::mutex& unblocked_mutex;
     unsigned& unblocked_count;
-
+
     void operator=(simple_upgrade_thread&);
-
+
 public:
     simple_upgrade_thread(boost::shared_mutex& rwm_,
                           boost::mutex& finish_mutex_,
@@ -32,16 +32,16 @@
         rwm(rwm_),finish_mutex(finish_mutex_),
         unblocked_mutex(unblocked_mutex_),unblocked_count(unblocked_count_)
     {}
-
+
     void operator()()
     {
         boost::upgrade_lock<boost::shared_mutex> lk(rwm);
-
+
         {
             boost::mutex::scoped_lock ulk(unblocked_mutex);
             ++unblocked_count;
         }
-
+
         boost::mutex::scoped_lock flk(finish_mutex);
     }
 };
@@ -50,7 +50,7 @@
 void test_only_one_upgrade_lock_permitted()
 {
     unsigned const number_of_threads=10;
-
+
     boost::thread_group pool;
 
     boost::shared_mutex rw_mutex;
@@ -61,7 +61,7 @@
     boost::condition_variable unblocked_condition;
     boost::mutex finish_mutex;
     boost::mutex::scoped_lock finish_lock(finish_mutex);
-
+
     try
     {
         for(unsigned i=0;i<number_of_threads;++i)
@@ -297,3 +297,16 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_shared_mutex_timed_locks.cpp
==============================================================================
--- branches/release/libs/thread/test/test_shared_mutex_timed_locks.cpp (original)
+++ branches/release/libs/thread/test/test_shared_mutex_timed_locks.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -237,7 +237,7 @@
     {
         rw_mutex.unlock();
     }
-
+
     boost::posix_time::milliseconds const wait_duration(500);
     timed_lock_succeeded=rw_mutex.timed_lock_shared(wait_duration);
     BOOST_CHECK(timed_lock_succeeded);
@@ -266,3 +266,16 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_thread.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread.cpp (original)
+++ branches/release/libs/thread/test/test_thread.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -2,7 +2,7 @@
 // William E. Kempf
 // Copyright (C) 2008 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/detail/config.hpp>
@@ -28,7 +28,7 @@
 void comparison_thread(boost::thread::id parent)
 {
     boost::thread::id const my_id=boost::this_thread::get_id();
-
+
     BOOST_CHECK(my_id != parent);
     boost::thread::id const my_id2=boost::this_thread::get_id();
     BOOST_CHECK(my_id == my_id2);
@@ -44,7 +44,7 @@
 
     // Ensure it's in a range instead of checking actual equality due to time
     // lapse
- BOOST_CHECK(in_range(xt, 2));
+ BOOST_CHECK(boost::threads::test::in_range(xt, 2));
 }
 
 void do_test_creation()
@@ -125,11 +125,11 @@
     boost::noncopyable
 {
     unsigned value;
-
+
     non_copyable_functor():
         value(0)
     {}
-
+
     void operator()()
     {
         value=999;
@@ -139,7 +139,7 @@
 void do_test_creation_through_reference_wrapper()
 {
     non_copyable_functor f;
-
+
     boost::thread thrd(boost::ref(f));
     thrd.join();
     BOOST_CHECK_EQUAL(f.value, 999u);
@@ -155,11 +155,11 @@
     boost::condition_variable cond;
     boost::mutex mut;
     bool done;
-
+
     long_running_thread():
         done(false)
     {}
-
+
     void operator()()
     {
         boost::mutex::scoped_lock lk(mut);
@@ -177,7 +177,7 @@
     BOOST_CHECK(thrd.joinable());
     boost::system_time xt=delay(3);
     bool const joined=thrd.timed_join(xt);
- BOOST_CHECK(in_range(boost::get_xtime(xt), 2));
+ BOOST_CHECK(boost::threads::test::in_range(boost::get_xtime(xt), 2));
     BOOST_CHECK(!joined);
     BOOST_CHECK(thrd.joinable());
     {
@@ -185,7 +185,7 @@
         f.done=true;
         f.cond.notify_one();
     }
-
+
     xt=delay(3);
     bool const joined2=thrd.timed_join(xt);
     boost::system_time const now=boost::get_system_time();
@@ -209,7 +209,7 @@
     t.swap(t2);
     BOOST_CHECK(t.get_id()==id2);
     BOOST_CHECK(t2.get_id()==id1);
-
+
     swap(t,t2);
     BOOST_CHECK(t.get_id()==id1);
     BOOST_CHECK(t2.get_id()==id2);
@@ -232,3 +232,17 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)boost::unit_test::first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+
+}

Modified: branches/release/libs/thread/test/test_thread_exit.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread_exit.cpp (original)
+++ branches/release/libs/thread/test/test_thread_exit.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,4 +1,4 @@
-// (C) Copyright 2009 Anthony Williams
+// (C) Copyright 2009 Anthony Williams
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -71,3 +71,16 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)boost::unit_test::first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_thread_id.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread_id.cpp (original)
+++ branches/release/libs/thread/test/test_thread_id.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,6 +1,6 @@
 // Copyright (C) 2007 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/thread.hpp>
 #include <boost/test/unit_test.hpp>
@@ -61,7 +61,7 @@
     BOOST_CHECK((t3.get_id()<t.get_id()) == (t.get_id()>=t3.get_id()));
     BOOST_CHECK((t2.get_id()<t3.get_id()) == (t3.get_id()>=t2.get_id()));
     BOOST_CHECK((t3.get_id()<t2.get_id()) == (t2.get_id()>=t3.get_id()));
-
+
     BOOST_CHECK((t.get_id()<=t2.get_id()) == (t2.get_id()>t.get_id()));
     BOOST_CHECK((t2.get_id()<=t.get_id()) == (t.get_id()>t2.get_id()));
     BOOST_CHECK((t.get_id()<=t3.get_id()) == (t3.get_id()>t.get_id()));
@@ -111,7 +111,7 @@
     BOOST_CHECK(!(default_id > t.get_id()));
     BOOST_CHECK(!(default_id > t2.get_id()));
     BOOST_CHECK(!(default_id > t3.get_id()));
-
+
     BOOST_CHECK(!(default_id >= t.get_id()));
     BOOST_CHECK(!(default_id >= t2.get_id()));
     BOOST_CHECK(!(default_id >= t3.get_id()));
@@ -120,7 +120,7 @@
     t2.join();
     t3.join();
 }
-
+
 void get_thread_id(boost::thread::id* id)
 {
     *id=boost::this_thread::get_id();
@@ -147,3 +147,16 @@
     test->add(BOOST_TEST_CASE(test_thread_id_of_running_thread_returned_by_this_thread_get_id));
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)boost::unit_test::first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+}

Modified: branches/release/libs/thread/test/test_thread_launching.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread_launching.cpp (original)
+++ branches/release/libs/thread/test/test_thread_launching.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,6 +1,6 @@
 // Copyright (C) 2007-8 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/thread.hpp>
 #include <boost/test/unit_test.hpp>
@@ -40,7 +40,7 @@
 struct callable_no_args
 {
     static bool called;
-
+
     void operator()() const
     {
         called=true;
@@ -61,7 +61,7 @@
     boost::noncopyable
 {
     static bool called;
-
+
     void operator()() const
     {
         called=true;
@@ -73,7 +73,7 @@
 void test_thread_callable_object_ref_no_arguments()
 {
     callable_noncopyable_no_args func;
-
+
     boost::thread callable(boost::ref(func));
     callable.join();
     BOOST_CHECK(callable_noncopyable_no_args::called);
@@ -83,7 +83,7 @@
 {
     static bool called;
     static int called_arg;
-
+
     void operator()(int arg) const
     {
         called=true;
@@ -112,7 +112,7 @@
     static std::string called_three_arg1;
     static std::vector<int> called_three_arg2;
     static int called_three_arg3;
-
+
     void operator()(int arg1,double arg2) const
     {
         called_two=true;
@@ -145,8 +145,10 @@
     }
 
     callable_multiple_arg func;
-
- boost::thread callable3(func,"hello",x,1.2);
+ // Avoid
+ // boost/bind/bind.hpp(392) : warning C4244: 'argument' : conversion from 'double' to 'int', possible loss of data
+
+ boost::thread callable3(func,"hello",x,1);
     callable3.join();
     BOOST_CHECK(callable_multiple_arg::called_three);
     BOOST_CHECK_EQUAL(callable_multiple_arg::called_three_arg1,"hello");
@@ -155,11 +157,11 @@
     {
         BOOST_CHECK_EQUAL(callable_multiple_arg::called_three_arg2.at(j),x[j]);
     }
-
+
     BOOST_CHECK_EQUAL(callable_multiple_arg::called_three_arg3,1);
 
     double const dbl=1.234;
-
+
     boost::thread callable2(func,19,dbl);
     callable2.join();
     BOOST_CHECK(callable_multiple_arg::called_two);
@@ -176,7 +178,7 @@
         function_called(false),
         arg_value(0)
     {}
-
+
 
     void f0()
     {
@@ -193,7 +195,7 @@
 void test_thread_member_function_no_arguments()
 {
     X x;
-
+
     boost::thread function(&X::f0,&x);
     function.join();
     BOOST_CHECK(x.function_called);
@@ -224,3 +226,17 @@
     test->add(BOOST_TEST_CASE(test_thread_member_function_one_argument));
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)boost::unit_test::first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+
+}

Modified: branches/release/libs/thread/test/test_thread_move.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread_move.cpp (original)
+++ branches/release/libs/thread/test/test_thread_move.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,6 +1,6 @@
 // Copyright (C) 2007-9 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/thread.hpp>
 #include <boost/test/unit_test.hpp>
@@ -54,3 +54,17 @@
     test->add(BOOST_TEST_CASE(test_move_assign));
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)boost::unit_test::first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+
+}

Modified: branches/release/libs/thread/test/test_thread_move_return.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread_move_return.cpp (original)
+++ branches/release/libs/thread/test/test_thread_move_return.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,7 +1,10 @@
 // Copyright (C) 2009 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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)
+
+#define BOOST_THREAD_USES_MOVE
+
 #include <boost/thread/thread.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -33,3 +36,17 @@
     test->add(BOOST_TEST_CASE(test_move_from_function_move_return));
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)boost::unit_test::first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+
+}

Modified: branches/release/libs/thread/test/test_thread_return_local.cpp
==============================================================================
--- branches/release/libs/thread/test/test_thread_return_local.cpp (original)
+++ branches/release/libs/thread/test/test_thread_return_local.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -1,7 +1,10 @@
 // Copyright (C) 2009 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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)
+
+#define BOOST_THREAD_USES_MOVE
+
 #include <boost/thread/thread.hpp>
 #include <boost/test/unit_test.hpp>
 
@@ -13,7 +16,7 @@
 boost::thread make_thread_return_local(boost::thread::id* the_id)
 {
     boost::thread t(do_nothing,the_id);
- return t;
+ return boost::move(t);
 }
 
 void test_move_from_function_return_local()
@@ -33,3 +36,17 @@
     test->add(BOOST_TEST_CASE(test_move_from_function_return_local));
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)boost::unit_test::first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+
+}

Modified: branches/release/libs/thread/test/test_tss.cpp
==============================================================================
--- branches/release/libs/thread/test/test_tss.cpp (original)
+++ branches/release/libs/thread/test/test_tss.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -2,7 +2,7 @@
 // William E. Kempf
 // Copyright (C) 2007 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/detail/config.hpp>
@@ -19,7 +19,7 @@
 
 #if defined(BOOST_HAS_WINTHREADS)
     #define WIN32_LEAN_AND_MEAN
- #include <windows.h>
+ #include <windows.h>
 #endif
 
 boost::mutex check_mutex;
@@ -76,7 +76,7 @@
     {
         native_thread_t const res=CreateThread(
             0, //security attributes (0 = not inheritable)
- 0, //stack size (0 = default)
+ 0, //stack size (0 = default)
             &test_tss_thread_native, //function to execute
             0, //parameter to pass to function
             0, //creation flags (0 = run immediately)
@@ -99,7 +99,7 @@
 
 extern "C"
 {
- void* test_tss_thread_native(void* lpParameter)
+ void* test_tss_thread_native(void* )
     {
         test_tss_thread();
         return 0;
@@ -109,7 +109,7 @@
     native_thread_t create_native_thread()
     {
         native_thread_t thread_handle;
-
+
         int const res = pthread_create(&thread_handle, 0, &test_tss_thread_native, 0);
         BOOST_CHECK(!res);
         return thread_handle;
@@ -261,12 +261,12 @@
 struct dummy_class_tracks_deletions
 {
     static unsigned deletions;
-
+
     ~dummy_class_tracks_deletions()
     {
         ++deletions;
     }
-
+
 };
 
 unsigned dummy_class_tracks_deletions::deletions=0;
@@ -357,3 +357,17 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)boost::unit_test::first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+
+}

Modified: branches/release/libs/thread/test/test_xtime.cpp
==============================================================================
--- branches/release/libs/thread/test/test_xtime.cpp (original)
+++ branches/release/libs/thread/test/test_xtime.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -2,7 +2,7 @@
 // William E. Kempf
 // Copyright (C) 2008 Anthony Williams
 //
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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 <boost/thread/detail/config.hpp>
@@ -85,7 +85,7 @@
     boost::condition_variable cond;
     boost::condition_variable_any cond_any;
     boost::mutex m;
-
+
     boost::mutex::scoped_lock lk(m);
     cond.timed_wait(lk,boost::get_xtime(boost::get_system_time()+boost::posix_time::milliseconds(10)));
     cond.timed_wait(lk,boost::get_xtime(boost::get_system_time()+boost::posix_time::milliseconds(10)),predicate);
@@ -107,3 +107,17 @@
 
     return test;
 }
+
+void remove_unused_warning()
+{
+
+ //../../../boost/test/results_collector.hpp:40:13: warning: unused function 'first_failed_assertion' [-Wunused-function]
+ //(void)boost::unit_test::first_failed_assertion;
+
+ //../../../boost/test/tools/floating_point_comparison.hpp:304:25: warning: unused variable 'check_is_close' [-Wunused-variable]
+ //../../../boost/test/tools/floating_point_comparison.hpp:326:25: warning: unused variable 'check_is_small' [-Wunused-variable]
+ (void)boost::test_tools::check_is_close;
+ (void)boost::test_tools::check_is_small;
+
+
+}

Modified: branches/release/libs/thread/test/util.inl
==============================================================================
--- branches/release/libs/thread/test/util.inl (original)
+++ branches/release/libs/thread/test/util.inl 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
@@ -19,6 +19,8 @@
 
 // boostinspect:nounnamed
 
+
+
 namespace
 {
 inline boost::xtime delay(int secs, int msecs=0, int nsecs=0)
@@ -41,6 +43,13 @@
     return xt;
 }
 
+}
+namespace boost
+{
+namespace threads
+{
+namespace test
+{
 inline bool in_range(const boost::xtime& xt, int secs=1)
 {
     boost::xtime min = delay(-secs);
@@ -48,7 +57,13 @@
     return (boost::xtime_cmp(xt, min) >= 0) &&
         (boost::xtime_cmp(xt, max) <= 0);
 }
+}
+}
+}
 
+
+namespace
+{
 class execution_monitor
 {
 public:
@@ -98,7 +113,9 @@
     wait_type type;
     int secs;
 };
-
+}
+namespace thread_detail_anon
+{
 template <typename F>
 class indirect_adapter
 {
@@ -126,18 +143,28 @@
     void operator=(indirect_adapter&);
 };
 
+}
+// boostinspect:nounnamed
+namespace
+{
+
 template <typename F>
 void timed_test(F func, int secs,
     execution_monitor::wait_type type=DEFAULT_EXECUTION_MONITOR_TYPE)
 {
     execution_monitor monitor(type, secs);
- indirect_adapter<F> ifunc(func, monitor);
+ thread_detail_anon::indirect_adapter<F> ifunc(func, monitor);
     monitor.start();
     boost::thread thrd(ifunc);
     BOOST_REQUIRE_MESSAGE(monitor.wait(),
         "Timed test didn't complete in time, possible deadlock.");
 }
 
+}
+
+namespace thread_detail_anon
+{
+
 template <typename F, typename T>
 class thread_binder
 {
@@ -151,11 +178,20 @@
     T param;
 };
 
+}
+
+// boostinspect:nounnamed
+namespace
+{
 template <typename F, typename T>
-thread_binder<F, T> bind(const F& func, const T& param)
+thread_detail_anon::thread_binder<F, T> bind(const F& func, const T& param)
 {
- return thread_binder<F, T>(func, param);
+ return thread_detail_anon::thread_binder<F, T>(func, param);
 }
+}
+
+namespace thread_detail_anon
+{
 
 template <typename R, typename T>
 class thread_member_binder
@@ -172,11 +208,15 @@
     T& param;
 };
 
+}
 
+// boostinspect:nounnamed
+namespace
+{
 template <typename R, typename T>
-thread_member_binder<R, T> bind(R (T::*func)(), T& param)
+thread_detail_anon::thread_member_binder<R, T> bind(R (T::*func)(), T& param)
 {
- return thread_member_binder<R, T>(func, param);
+ return thread_detail_anon::thread_member_binder<R, T>(func, param);
 }
 } // namespace
 

Deleted: branches/release/libs/thread/tutorial/helloworld4.cpp
==============================================================================
--- branches/release/libs/thread/tutorial/helloworld4.cpp 2012-05-22 13:03:15 EDT (Tue, 22 May 2012)
+++ (empty file)
@@ -1,20 +0,0 @@
-// Copyright (C) 2001-2003
-// William E. Kempf
-//
-// 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 <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
-#include <iostream>
-
-void helloworld(const char* who)
-{
- std::cout << who << "says, \"Hello World.\"" << std::endl;
-}
-
-int main()
-{
- boost::thread thrd(boost::bind(&helloworld, "Bob"));
- thrd.join();
-}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk