mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-08 07:56:55 -04:00
This patch adds `CrossProcessLockGeneration`. A lock generation is an integer incremented each time the lock is taken by another holder. If the generation changes, it means the lock is _dirtied_. This _dirtying_ aspect is going to be expanded in the next patches. This patch focuses on the introduction of this _generation_. The `CrossProcessLock::try_lock_once` method, and the `TryLock::try_lock` method, both returns a `Option<CrossProcessLockGeneration>` instead of a `bool`: `true` is replaced by `Some(_)`, `false` by `None`.