diff options
author | Wedson Almeida Filho <walmeida@microsoft.com> | 2023-03-27 21:43:08 +0300 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2023-04-22 02:46:30 +0300 |
commit | e32cca32c3d452a277884502b9155f3325caf80e (patch) | |
tree | 23cb2737222c1585c8ac6a0c2e64045503f28c69 /rust/kernel/sync.rs | |
parent | 7b1f55e3a984aaed0121f90f9f8580f18b7b561e (diff) | |
download | linux-e32cca32c3d452a277884502b9155f3325caf80e.tar.xz |
rust: lock: add `Guard::do_unlocked`
It releases the lock, executes some function provided by the caller,
then reacquires the lock. This is preparation for the implementation of
condvars, which will sleep after between unlocking and relocking.
We need an explicit `relock` method for primitives like `SpinLock` that
have an irqsave variant: we use the guard state to determine if the lock
was originally acquired with the regular `lock` function or
`lock_irqsave`.
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Link: https://lore.kernel.org/rust-for-linux/20230412121431.41627-1-wedsonaf@gmail.com/
[ Removed the irqsave bits as discussed. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/sync.rs')
0 files changed, 0 insertions, 0 deletions