Documentation Home >> Headers >> <mutex> Header

The <mutex> header provides facilities for ensuring mutual exclusion: mutex types, lock types and functions, and a mechanism for ensuring an operation is performed exactly once.

namespace std
{
    class mutex;
    class recursive_mutex;
    class timed_mutex;
    class recursive_timed_mutex;

    struct adopt_lock_t;
    struct defer_lock_t;
    struct try_to_lock_t;

    extern const adopt_lock_t adopt_lock;
    extern const defer_lock_t defer_lock;
    extern const try_to_lock_t try_to_lock;

    template<typename LockableType>
    class lock_guard;

    template<typename LockableType>
    class unique_lock;

    template<
        typename LockableType1,
        typename... LockableType2>
    void lock(LockableType1& m1,LockableType2& m2...);

    template<
        typename LockableType1,
        typename... LockableType2>
    int try_lock(
        LockableType1& m1,LockableType2& m2...);

    struct once_flag;

    template<typename Callable,typename... Args>
    void call_once(
        once_flag& flag,Callable func,Args args...);
}

namespace jss
{
    class generic_lock_guard;
}
See Also