| Home | Libraries | People | FAQ | More

## History

#### Version 3.0.0 - boost 1.50

New Features:

- #1850 Request for unlock_guard to compliment lock_guard.
- #2637 Request for shared_mutex duration timed_lock and timed_lock_shared.
- #2741 Proposal to manage portable and non portable thread attributes.
- #3567 Request for shared_lock_guard.
- #6194 Adapt to Boost.Move.
- #6195 c++11 compliance: Provide the standard time related interface using Boost.Chrono.
- #6217 Enhance Boost.Thread shared mutex interface following Howard Hinnant proposal.
- #6224 c++11 compliance: Add the use of standard noexcept on compilers supporting them.
- #6225 Add the use of standard =delete defaulted operations on compilers supporting them.
- #6226 c++11 compliance: Add explicit bool conversion from locks.
- #6228 Add promise constructor with allocator following the standard c++11.
- #6229 Rename the unique_future to future following the c++11.
- #6230 c++11 compliance: Follows the exception reporting mechanism as defined in the c++11.
- #6231 Add BasicLockable requirements in the documentation to follow c++11.
- #6266 Breaking change: thread destructor should call terminate if joinable.
- #6269 Breaking change: thread move assignment should call terminate if joinable.
- #6272 c++11 compliance: Add thread::id hash specialization.
- #6273 c++11 compliance: Add cv_status enum class and use it on the conditions wait functions.
- #6342 c++11 compliance: Adapt the one_flag to the c++11 interface.
- #6671 upgrade_lock: missing mutex and release functions.
- #6672 upgrade_lock:: missing constructors from time related types.
- #6675 upgrade_lock:: missing non-member swap.
- #6676 lock conversion should be explicit.
- Added missing packaged_task::result_type and packaged_task:: constructor with allocator.
- Added packaged_task::reset()

Fixed Bugs:

- #2380 boost::move from lvalue does not work with gcc.
- #2430 shared_mutex for win32 doesn't have timed_lock_upgrade.
- #2575 Bug- Boost 1.36.0 on Itanium platform.
- #3160 Duplicate tutorial code in boost::thread.
- #4345 thread::id and joining problem with cascade of threads.
- #4521 Error using boost::move on packaged_task (MSVC 10).
- #4711 Must use implementation details to return move-only types.
- #4921 BOOST_THREAD_USE_DLL and BOOST_THREAD_USE_LIB are crucial and need to be documented.
- #5013 documentation: boost::thread: pthreas_exit causes terminate().
- #5173 boost::this_thread::get_id is very slow.
- #5351 interrupt a future get boost::unknown_exception.
- #5516 Upgrade lock is not acquired when previous upgrade lock releases if another read lock is present.
- #5990 shared_future<T>::get() has wrong return type.
- #6174 packaged_task doesn't correctly handle moving results.
- #6222 Compile error with SunStudio: unique_future move.
- #6354 PGI: Compiler threading support is not turned on.
- #6673 shared_lock: move assign doesn't works with c++11.
- #6674 shared_mutex: try_lock_upgrade_until doesn't works.
- #6908 Compile error due to unprotected definitions of _WIN32_WINNT and WINVER.
- #6940 TIME_UTC is a macro in C11.
- #6959 call of abs is ambiguous.
- Fix issue signaled on the ML with task_object(task_object const&) in presence of task_object(task_object &&)

#### Version 2.1.1 - boost 1.49

Fixed Bugs:

- #2309 Lack of g++ symbol visibility support in Boost.Thread.
- #2639 documentation should be extended(defer_lock, try_to_lock, ...).
- #3639 Boost.Thread doesn't build with Sun-5.9 on Linux.
- #3762 Thread can't be compiled with winscw (Codewarrior by Nokia).
- #3885 document about mix usage of boost.thread and native thread api.
- #3975 Incorrect precondition for promise::set_wait_callback().
- #4048 thread::id formatting involves locale
- #4315 gcc 4.4 Warning: inline ... declared as dllimport: attribute ignored.
- #4480 OpenVMS patches for compiler issues workarounds.
- #4819 boost.thread's documentation misprints.
- #5423 thread issues with C++0x.
- #5617 boost::thread::id copy ctor.
- #5739 set-but-not-used warnings with gcc-4.6.
- #5826 threads.cpp: resource leak on threads creation failure.
- #5839 thread.cpp: ThreadProxy leaks on exceptions.
- #5859 win32 shared_mutex constructor leaks on exceptions.
- #6100 Compute hardware_concurrency() using get_nprocs() on GLIBC systems.
- #6168 recursive_mutex is using wrong config symbol (possible typo).
- #6175 Compile error with SunStudio.
- #6200 patch to have condition_variable and mutex error better handle EINTR.
- #6207 shared_lock swap compiler error on clang 3.0 c++11.
- #6208 try_lock_wrapper swap compiler error on clang 3.0 c++11.

#### 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.

#### Changes since boost 1.35

The 1.36.0 release of Boost includes a few new features in the thread library:

- New generic `lock()` and `try_lock()` functions for locking multiple mutexes at once.
- Rvalue reference support for move semantics where the compilers supports it.
- A few bugs fixed and missing functions added (including the serious win32 condition variable bug).
- `scoped_try_lock` types are now backwards-compatible with Boost 1.34.0 and previous releases.
- Support for passing function arguments to the thread function by supplying additional arguments to the `boost::thread` constructor.
- Backwards-compatibility overloads added for `timed_lock` and `timed_wait` functions to allow use of `xtime` for timeouts.

#### 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 changes are described below.

#### New Features

- Instances of `boost::thread` and of the various lock types are now movable.
- Threads can be interrupted at interruption points.
- Condition variables can now be used with any type that implements the `Lockable` concept, through the use of `boost::condition_variable_any` (`boost::condition` is a `typedef` to `boost::condition_variable_any`, provided for backwards compatibility). `boost::condition_variable` is provided as an optimization, and will only work with `boost::unique_lock<boost::mutex>` (`boost::mutex::scoped_lock`).
- Thread IDs are separated from `boost::thread`, so a thread can obtain it's own ID (using `boost::this_thread::get_id()`), and IDs can be used as keys in associative containers, as they have the full set of comparison operators.
- Timeouts are now implemented using the Boost DateTime library, through a typedef `boost::system_time` for absolute timeouts, and with support for relative timeouts in many cases. `boost::xtime` is supported for backwards compatibility only.
- Locks are implemented as publicly accessible templates `boost::lock_guard`, `boost::unique_lock`, `boost::shared_lock`, and `boost::upgrade_lock`, which are templated on the type of the mutex. The `Lockable` concept has been extended to include publicly available `lock()` and `unlock()` member functions, which are used by the lock types.

#### Breaking Changes

The list below should cover all changes to the public interface which break backwards compatibility.

- `boost::try_mutex` has been removed, and the functionality subsumed into `boost::mutex`. `boost::try_mutex` is left as a `typedef`, but is no longer a separate class.
- `boost::recursive_try_mutex` has been removed, and the functionality subsumed into `boost::recursive_mutex`. `boost::recursive_try_mutex` is left as a `typedef`, but is no longer a separate class.
- `boost::detail::thread::lock_ops` has been removed. Code that relies on the `lock_ops` implementation detail will no longer work, as this has been removed, as it is no longer necessary now that mutex types now have public `lock()` and `unlock()` member functions.
- `scoped_lock` constructors with a second parameter of type `bool` are no longer provided. With previous boost releases,

      boost::mutex::scoped_lock some_lock(some_mutex,false);

  could be used to create a lock object that was associated with a mutex, but did not lock it on construction. This facility has now been replaced with the constructor that takes a `boost::defer_lock_type` as the second parameter:

      boost::mutex::scoped_lock some_lock(some_mutex,boost::defer_lock);

- The `locked()` member function of the `scoped_lock` types has been renamed to `owns_lock()`.
- You can no longer obtain a `boost::thread` instance representing the current thread: a default-constructed `boost::thread` object is not associated with any thread. The only use for such a thread object was to support the comparison operators: this functionality has been moved to `boost::thread::id`.
- The broken `boost::read_write_mutex` has been replaced with `boost::shared_mutex`.
- `boost::mutex` is now never recursive. For Boost releases prior to 1.35 `boost::mutex` was recursive on Windows and not on POSIX platforms.
- When using a `boost::recursive_mutex` with a call to `boost::condition_variable_any::wait()`, the mutex is only unlocked one level, and not completely. This prior behaviour was not guaranteed and did not feature in the tests.