std::recursive_timed_mutex::unlock
提供:cppreference.com
< cpp | thread | recursive timed mutex
|
|
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. |
| void unlock(); |
(C + + 11以来) | |
ミューテックスのロックを解除.
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.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] パラメータ
(なし)
Original:
(none)
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:
(none)
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.
[編集] 例外
| This section is incomplete |
[編集] 例
この例では、ロック、try_lockとアクションでロック解除を示しています
Original:
This example shows lock, try_lock and unlock in action
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.
#include <iostream> #include <mutex> int main() { std::mutex test; if (test.try_lock()==true) std::cout << "lock acquired" << std::endl; else std::cout << "lock not acquired" << std::endl; test.unlock(); //now unlock the mutex test.lock(); //to lock it again if (test.try_lock()) //true can be left out std::cout << "lock acquired" << std::endl; else std::cout << "lock not acquired" << std::endl; test.lock(); //and now the finale (a block) }
Output:
lock acquired lock not acquired (program hangs)
[編集] も参照してください
| ミューテックスは、ミューテックスが使用できない場合はブロックし、ロックします 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. (パブリックメンバ関数) | |
| ミューテックスが使用できない場合は戻りますが、mutexをロックしようとします 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持っている場合、返品をmutexをロックしようとします 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. (パブリックメンバ関数) | |
| 、mutexをロックしようとし、指定された時点に達するまで、ミューテックスが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. (パブリックメンバ関数) | |