feat update
Some checks failed
rpcrypto-build / build (Debug, hisiv510.toolchain.cmake) (push) Successful in 1m21s
rpcrypto-build / build (Debug, himix200.toolchain.cmake) (push) Successful in 1m23s
rpcrypto-build / build (Release, himix200.toolchain.cmake) (push) Successful in 1m28s
rpcrypto-build / build (Release, hisiv510.toolchain.cmake) (push) Successful in 1m26s
linux-x64-gcc / linux-gcc (push) Failing after 1m17s
linux-mips64-gcc / linux-gcc-mips64el (push) Failing after 1m40s
linux-hisiv500-gcc / linux-gcc-hisiv500 (push) Successful in 1m49s

This commit is contained in:
tqcq 2024-02-27 14:55:48 +08:00
parent 6b2bb26713
commit 0f7c0f91ca

View File

@ -69,8 +69,10 @@ TimerManager::AddTimerImpl(const Timer::ExpireCallback &cb,
}
{
MutexGuard timers_guard(timers_lock_);
timers_cond_.NotifyAll();
if (timers_lock_.TryLock()) {
timers_cond_.NotifyAll();
timers_lock_.Unlock();
}
}
return timer->id();
}
@ -82,9 +84,13 @@ TimerManager::CancelTimerImpl(TimerId timer_id)
MutexGuard guard(timer_canceling_set_lock_);
timer_canceling_set_.insert(timer_id);
}
{
MutexGuard timers_guard(timers_lock_);
timers_cond_.NotifyAll();
// MutexGuard timers_guard(timers_lock_);
if (timers_lock_.TryLock()) {
timers_cond_.NotifyAll();
timers_lock_.Unlock();
}
}
}