| 105 | } |
| 106 | |
| 107 | std::unique_lock<std::mutex> ConditionVariable::toStdLock(std::unique_lock<Mutex>& lock) { |
| 108 | if (lock.owns_lock()) { |
| 109 | return std::unique_lock<std::mutex>(lock.release()->_innerMutex, std::adopt_lock_t()); |
| 110 | } else { |
| 111 | return std::unique_lock<std::mutex>(lock.release()->_innerMutex, std::defer_lock_t()); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | std::unique_lock<Mutex> ConditionVariable::toValdiLock(std::unique_lock<std::mutex>& lock, Mutex* mutex) { |
| 116 | if (lock.owns_lock()) { |
| 117 | lock.release(); |
| 118 | mutex->onLockAcquired(); |
| 119 | return std::unique_lock<Mutex>(*mutex, std::adopt_lock_t()); |
nothing calls this directly
no test coverage detected