Namespaces
Variants
Views
Actions

std::unique_lock

From cppreference.com
< cpp‎ | thread
Revision as of 13:15, 12 November 2011 by P12bot (Talk | contribs)

Template:cpp/thread/unique lock/sidebar

Defined in header <mutex>
template<typename Mutex>
class unique_lock;
Template:mark c++11 feature

The class Template:cpp implements general-purpose mutex ownership wrapper allowing deferred locking, timed locking, recursive locking, transfer of lock ownership, and use with condition variables. The class is non-copyable but movable.

Contents

Member types

Template:tdcl list begin Template:tdcl list hitem Template:tdcl list item Template:tdcl list end

Member functions

Constructs a unique_lock, optionally locking the supplied mutex
(public member function)
Unlocks the supplied mutex, if owned
(public member function)
Unlocks the mutex, if owned, and acquires ownership of another
(public member function)
Locks the supplied mutex
(public member function)
Attempts to lock the supplied mutex
(public member function)
Attempts to lock the supplied TimedLockable mutex for specified Template:cpp
(public member function)
Attempts to lock the supplied TimedLockable mutex until specified Template:cpp
(public member function)
Unlocks the supplied mutex
(public member function)
Swaps state with another Template:cpp
(public member function)
Returns a pointer to the supplied mutex
(public member function)
Unlocks the mutex and returns a pointer to the mutex object
(public member function)
Tests if this unique_lock owns its mutex
(public member function)
Tests if this unique_lock owns its mutex
(public member function)

Helper classes

tag type used to disambiguate unique_lock constructors
(class)
tag type used to disambiguate unique_lock constructors
(class)
tag type used to disambiguate unique_lock constructors
(class)

Non-member constants

tag constant used to disambiguate unique_lock constructors
(constant)
tag constant used to disambiguate unique_lock constructors
(constant)
tag constant used to disambiguate unique_lock constructors
(constant)

Non-member functions

Specialization of std::swap for unique_locks
(function template)

Example

Template:example cpp