-
- Downloads
rust: sync: lock: Add `Backend::BackendInContext`
`SpinLock`'s backend can be used for `SpinLockIrq`, if the interrupts
are disabled. And it actually provides performance gains since
interrupts are not needed to be disabled anymore. So add
`Backend::BackendInContext` to describe the case where one backend can
be used for another. Use the it to implement the `lock_with()` so that
`SpinLockIrq` can avoid disabling interrupts by using `SpinLock`'s
backend.
Signed-off-by:
Boqun Feng <boqun.feng@gmail.com>
Please register or sign in to comment