condition_variable Class

Use the condition_variable class to wait for an event when you have a mutex of type unique_lock<mutex>. Objects of this type may have better performance than objects of type condition_variable_any<unique_lock<mutex>>.

class condition_variable;

Members

Public Constructors

Name

Description

condition_variable::condition_variable Constructor

Constructs a condition_variable object.

Public Methods

Name

Description

condition_variable::native_handle Method

Returns the implementation-specific type representing the condition_variable handle.

condition_variable::notify_all Method

Unblocks all threads that are waiting for the condition_variable object.

condition_variable::notify_one Method

Unblocks one of the threads that are waiting for the condition_variable object.

condition_variable::wait Method

Blocks a thread.

condition_variable::wait_for Method

Blocks a thread, and sets a time interval after which the thread unblocks.

condition_variable::wait_until Method

Blocks a thread, and sets a maximum point in time at which the thread unblocks.

Requirements

Header: condition_variable

Namespace: std

See Also

Reference

<condition_variable>

Other Resources

C++ Standard Library Header Files