fix scoped_refptr

This commit is contained in:
tqcq
2024-02-25 19:04:21 +08:00
parent e3fd80811a
commit d4deb0ae03
6 changed files with 737 additions and 11 deletions

View File

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