std::timed_mutex::timed_mutex

timed_mutex(); (1) (since C++11) timed_mutex( const timed_mutex& ) = delete; (2) (since C++11) 1) Constructs the mutex. The mutex is in unlocked state after the call. 2) Copy constructor is deleted. Parameters (none). Exceptions std::system_error if the construction is unsuccessful.

std::timed_mutex::native_handle

native_handle_type native_handle(); (since C++11) (optional) Returns the underlying implementation-defined native handle object. Parameters (none). Return value Implementation-defined native handle object. Exceptions Implementation-defined. Example

std::timed_mutex::lock

void lock(); (since C++11) Locks the mutex. If another thread has already locked the mutex, a call to lock will block execution until the lock is acquired. If lock is called by a thread that already owns the mutex, the behavior is undefined: the program may deadlock, or, if the implementation can detect the deadlock, a resource_deadlock_would_occur error condition may be thrown. Prior unlock() operation on the same mutex synchronizes-with (as defined in std::memory_order) this operation

std::timed_mutex

Defined in header <mutex> class timed_mutex; (since C++11) The timed_mutex class is a synchronization primitive that can be used to protect shared data from being simultaneously accessed by multiple threads. In a manner similar to mutex, timed_mutex offers exclusive, non-recursive ownership semantics. In addition, timed_mutex provides the ability to attempt to claim ownership of a timed_mutex with a timeout via the try_lock_for() and try_lock_until() methods. The timed_mute

std::throw_with_nested

Defined in header <exception> template< class T > [[noreturn]] void throw_with_nested( T&& t ); (since C++11) If std::remove_reference_t<T> is a non-final non-union class type that is neither std::nested_exception nor derived from std::nested_exception, throws an exception of an unspecified type that is publicly derived from both std::nested_exception and from std::remove_reference_t<T>, and constructed from std::forward<T>(t). The default co

std::thread::thread

std::time

Defined in header <ctime> std::time_t time( std::time_t* arg ); Returns the current calendar time encoded as a std::time_t object, and also stores it in the object pointed to by arg, unless arg is a null pointer. Parameters arg - pointer to a std::time_t object to store the time, or a null pointer Return value Current calendar time encoded as std::time_t object on success, (std::time_t)(-1) on error. If arg is not null, the return value is also stored in the o

std::tie

Defined in header <tuple> template< class... Types > tuple<Types&...> tie( Types&... args ); (since C++11) (until C++14) template< class... Types > constexpr tuple<Types&...> tie( Types&... args ); (since C++14) Creates a tuple of lvalue references to its arguments or instances of std::ignore. Parameters args - zero or more lvalue arguments to construct the tuple from Return value A std::tuple object containing lva

std::thread::id::id

id(); (since C++11) Default-constructs a new thread identifier. The identifier does not represent a thread. Parameters (none). Exceptions noexcept specification: noexcept

std::thread::swap

void swap( thread& other ); (since C++11) Exchanges the underlying handles of two thread objects. Parameters other - the thread to swap with Return value (none). Exceptions noexcept specification: noexcept Example #include <iostream> #include <thread> #include <chrono> void foo() { std::this_thread::sleep_for(std::chrono::seconds(1)); } void bar() { std::this_thread::sleep_for(std::chrono::seconds(1)); } int main() { std::t