std::recursive_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 recursive_mutex; |
(C++11 起) | |
。
recursive_mutex類是一個同步原語,可用於保護共享數據被同時由多個線程訪問.Original:
The
recursive_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.
。
recursive_mutex提供獨特的,遞歸的所有權語義。Original:
recursive_mutex offers exclusive, recursive ownership semantics: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.
- 。 調用線程「擁有」一個
recursive_mutex了一段時間,開始時,它成功地調用函數lock或try_lock。在此期間,該線程可能再次調用lock或try_lock。所有權的周期結束時,線程進行匹配的調用次數unlock.Original:A calling thread owns arecursive_mutexfor a period of time that starts when it successfully calls eitherlockortry_lock. During this period, the thread may make additional calls tolockortry_lock. The period of ownership ends when the thread makes a matching number of calls tounlock.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.- 。當一個線程擁有一個
recursive_mutex,所有其他線程將阻止(調用lock),或者如果他們試圖宣稱擁有的false收到try_lock返回值(為recursive_mutex).Original:When a thread owns arecursive_mutex, all other threads will block (for calls tolock) or receive a false return value (fortry_lock) if they attempt to claim ownership of therecursive_mutex.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - 。 ,
recursive_mutex可能會被鎖定的最大數量是不確定的,但達到這個數字後,調用lock將拋出std::system_error和調用try_lock將返回false.Original:The maximum number of times that arecursive_mutexmay be locked is unspecified, but after that number is reached, calls tolockwill throw std::system_error and calls totry_lockwill return false.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
程序的行為是不確定的,如果一個recursive_mutex被破壞,同時還擁有由某個線程。recursive_mutex類是不可複製的。Original:The behavior of a program is undefined if arecursive_mutexis destroyed while still owned by some thread. Therecursive_mutexclass 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.[编辑] 。會員類型。
。會員類型。Original:Member typeThe 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-definedThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.[编辑] 。成員函數。
構造該互斥量Original:constructs the mutexThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(公共成員函數)。鎖定。Original:LockingThe 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 availableThe 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 availableThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(公共成員函數)互斥量被釋放Original:unlocks the mutexThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(公共成員函數)。本機手柄。Original:Native handleThe 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 handleThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(公共成員函數) -