libstdc++: std::timed_mutex Class Reference

libstdc++

std::timed_mutex Class Reference
Concurrency » Mutexes

`#include <mutex>`

## Public Types
typedef __native_type * | native_handle_type

## Public Member Functions
| timed_mutex (const timed_mutex &)=delete
void | lock ()
native_handle_type | native_handle () noexcept
timed_mutex & | operator= (const timed_mutex &)=delete
bool | try_lock () noexcept
template<class _Rep, class _Period>
bool | try_lock_for (const chrono::duration< _Rep, _Period > &__rtime)
template<class _Clock, class _Duration>
bool | try_lock_until (const chrono::time_point< _Clock, _Duration > &__atime)
void | unlock ()

## Friends
class | __timed_mutex_impl< timed_mutex >

## Detailed Description

The standard timed mutex type.

A non-recursive mutex that supports a timeout when trying to acquire the lock.

Since
  C++11

Definition at line 228 of file mutex.

## Member Typedef Documentation

## ◆ native_handle_type

typedef __native_type* std::timed_mutex::native_handle_type

Definition at line 232 of file mutex.

## Member Function Documentation

## ◆ lock()

void std::timed_mutex::lock | ( |  | ) |
| inline

Definition at line 241 of file mutex.

## ◆ native_handle()

native_handle_type std::timed_mutex::native_handle | ( |  | ) |
| inlinenoexcept

Definition at line 278 of file mutex.

## ◆ try_lock()

bool std::timed_mutex::try_lock | ( |  | ) |
| inlinenodiscardnoexcept

Definition at line 252 of file mutex.

## ◆ try_lock_for()

template<class _Rep, class _Period>

bool std::timed_mutex::try_lock_for | ( | const chrono::duration< _Rep, _Period > & | __rtime | ) |
| inlinenodiscard

Definition at line 261 of file mutex.

## ◆ try_lock_until()

template<class _Clock, class _Duration>

bool std::timed_mutex::try_lock_until | ( | const chrono::time_point< _Clock, _Duration > & | __atime | ) |
| inlinenodiscard

Definition at line 267 of file mutex.

## ◆ unlock()

void std::timed_mutex::unlock | ( |  | ) |
| inline

Definition at line 271 of file mutex.

## Friends And Related Symbol Documentation

## ◆ __timed_mutex_impl< timed_mutex >

friend class __timed_mutex_impl< timed_mutex >
| friend

Definition at line 278 of file mutex.

The documentation for this class was generated from the following file:

- mutex