QRecursiveMutex 類提供在綫程之間串行化訪問。 更多...
| 頭: | #include <QRecursiveMutex> |
| qmake: | QT += core |
| Since: | Qt 5.14 |
| 繼承: | QMutex (private) |
該類在 Qt 5.14 引入。
注意: 此類的所有函數 綫程安全 .
| QRecursiveMutex () | |
| ~QRecursiveMutex () |
QRecursiveMutex 類是互斥的像 QMutex ,采用可兼容 API。它不同於 QMutex 通過接受 lock () 調用來自同一綫程任意次數。 QMutex 在這種情況下,會死鎖。
QRecursiveMutex is much more expensive to construct and operate on, so use a plain QMutex whenever you can. Sometimes, one public function, however, calls another public function, and they both need to lock the same mutex. In this case, you have two options:
另請參閱 QMutex , QMutexLocker , QReadWriteLock , QSemaphore ,和 QWaitCondition .
構造新的遞歸互斥。互斥是在解鎖狀態下創建的。
銷毀互斥。
警告: 銷毀鎖定互斥可能導緻未定義行為。