linux-IllusionX/rust
Alice Ryhl e7b9b1ff1d rust: sync: add CondVar::wait_timeout
Sleep on a condition variable with a timeout.

This is used by Rust Binder for process freezing. There, we want to
sleep until the freeze operation completes, but we want to be able to
abort the process freezing if it doesn't complete within some timeout.

Note that it is not enough to avoid jiffies by introducing a variant of
`CondVar::wait_timeout` that takes the timeout in msecs because we need
to be able to restart the sleep with the remaining sleep duration if it
is interrupted, and if the API takes msecs rather than jiffies, then
that would require a conversion roundtrip jiffies->msecs->jiffies that
is best avoided.

Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Tiago Lam <tiagolam@gmail.com>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20240108-rb-new-condvar-methods-v4-3-88e0c871cc05@google.com
[ Added `CondVarTimeoutResult` re-export and fixed typo. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-01-28 20:54:35 +01:00
..
alloc rust: upgrade to Rust 1.75.0 2024-01-22 15:18:05 +01:00
bindings rust: time: add msecs to jiffies conversion 2024-01-28 19:50:48 +01:00
kernel rust: sync: add CondVar::wait_timeout 2024-01-28 20:54:35 +01:00
macros rust: support srctree-relative links 2023-12-21 20:54:17 +01:00
uapi net: phy: add Rust Asix PHY driver 2023-12-15 09:35:50 +00:00
.gitignore rust: support running Rust documentation tests as KUnit ones 2023-07-19 09:32:53 -06:00
bindgen_parameters rust: Ignore preserve-most functions 2023-12-13 01:09:55 +01:00
build_error.rs rust: add build_error crate 2022-12-04 01:59:16 +01:00
compiler_builtins.rs rust: upgrade to Rust 1.73.0 2023-10-15 21:25:08 +02:00
exports.c rust: replace <linux/module.h> with <linux/export.h> in rust/exports.c 2023-12-13 01:09:55 +01:00
helpers.c rust: workqueue: add helper for defining work_struct fields 2023-09-25 09:46:42 -10:00
Makefile rust: support srctree-relative links 2023-12-21 20:54:17 +01:00