summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorAlice Ryhl <aliceryhl@google.com>2024-10-23 13:23:18 +0000
committerMiguel Ojeda <ojeda@kernel.org>2024-11-10 22:56:57 +0100
commit8eea62ff94f4dbad8ee884b0b33202e0a0fb350b (patch)
tree38c5b3bd99c961d7edb164060959be459a38de80 /samples
parentae7851c29747fa3765ecb722fe722117a346f988 (diff)
rust: sync: add global lock support
Add support for creating global variables that are wrapped in a mutex or spinlock. The implementation here is intended to replace the global mutex workaround found in the Rust Binder RFC [1]. In both cases, the global lock must be initialized before first use. The macro is unsafe to use for the same reason. The separate initialization step is required because it is tricky to access the value of __ARCH_SPIN_LOCK_UNLOCKED from Rust. Doing so will require changes to the C side. That change will happen as a follow-up to this patch. Link: https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-2-08ba9197f637@google.com/#Z31drivers:android:context.rs [1] Signed-off-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Link: https://lore.kernel.org/r/20241023-static-mutex-v6-1-d7efdadcc84f@google.com [ Simplified a few intra-doc links. Formatted a few comments. Reworded title. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'samples')
0 files changed, 0 insertions, 0 deletions