Fix possibly broken event handling in `SyncthingProcess`

The lock must not only be tried to be acquired. Otherwise we'd might skip
e.g. the exit handler when one of the other handlers still owns the lock.
This commit is contained in:
Martchus 2023-01-12 22:57:11 +01:00
parent bae5779cb3
commit 2c892d583f
1 changed files with 1 additions and 1 deletions

View File

@ -331,7 +331,7 @@ Data::SyncthingProcessInternalData::SyncthingProcessInternalData(boost::asio::io
Data::SyncthingProcessInternalData::Lock::Lock(const std::weak_ptr<SyncthingProcessInternalData> &weak)
: process(weak.lock())
, lock(process ? decltype(lock)(process->mutex, std::try_to_lock) : decltype(lock)())
, lock(process ? decltype(lock)(process->mutex) : decltype(lock)())
{
}