fix replace MutexLock by LockGuard<Mutex>

This commit is contained in:
tqcq
2024-02-24 10:40:15 +08:00
parent b1a9a8a17f
commit 9cc2ec86b7
2 changed files with 41 additions and 36 deletions

View File

@@ -32,7 +32,7 @@ Event::Wait(TimeDelta give_up_after, TimeDelta warn_after)
{
MutexLock lock(&mutex_);
bool wait_success =
cv_.WaitFor(&mutex_, give_up_after, [&] { return event_status_; });
cv_.WaitFor(lock, give_up_after, [&] { return event_status_; });
if (!wait_success) { return false; }
if (!is_manual_reset_) { event_status_ = false; }