Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Chapter 28. Thread

Anthony Williams

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at

Table of Contents

Changes since
Thread Management
Class thread
Namespace this_thread
Class thread_group
Mutex Concepts
Lock Types
Lock functions
Mutex Types
Condition Variables
One-time Initialization
Thread Local Storage
Class thread_specific_ptr
Date and Time Requirements
Typedef system_time
Non-member function get_system_time()
Compliance with standard
C++11 standard Thread library
Shared Mutex library extension

Boost.Thread enables the use of multiple threads of execution with shared data in portable C++ code. It provides classes and 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 closely follow the proposals presented to the C++ Standards Committee, in particular N2497, N2320, N2184, N2139, and N2094

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:

#include <boost/thread.hpp>

which includes all the other headers in turn.