std::timed_mutex
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <mutex>
|
||
| class timed_mutex; |
(C++11 起) | |
。
timed_mutex类是一个同步原语,可用于保护共享数据被同时由多个线程访问. Original:
The
timed_mutex class is a synchronization primitive that can be used to protect shared data from being simultaneously accessed by multiple threads. The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
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.
。
timed_mutex类是不可复制的。Original:
The
timed_mutex class is non-copyable.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 。会员类型。
| 。会员类型。
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
native_handle_type
|
。 “实现自定义”。
Original: implementation-defined The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[编辑] 。成员函数。
| 构造该互斥量 Original: constructs the mutex The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
Original: Locking The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 锁住互斥体,块,如果该互斥锁不可用 Original: locks the mutex, blocks if the mutex is not available The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 试图锁定互斥锁,则返回,如果该互斥锁不可用 Original: tries to lock the mutex, returns if the mutex is not available The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 试图锁定互斥锁,则返回在指定的超时时间,如果互斥体有been unavailable的 Original: tries to lock the mutex, returns if the mutex has been unavailable for the specified timeout duration The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 试图锁定互斥锁,返回到指定的时间点已经达到,如果互斥been unavailable的 Original: tries to lock the mutex, returns if the mutex has been unavailable until specified time point has been reached The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 互斥量被释放 Original: unlocks the mutex The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
Original: Native handle The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| 返回底层实现定义的线程句柄 Original: returns the underlying implementation-defined thread handle The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |