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:
parent
bae5779cb3
commit
2c892d583f
|
@ -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)())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue