rust: lock: introduce Mutex

This is the `struct mutex` lock backend and allows Rust code to use the
kernel mutex idiomatically.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Will Deacon <will@kernel.org>
Cc: Waiman Long <longman@redhat.com>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Link: https://lore.kernel.org/r/20230411054543.21278-3-wedsonaf@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
Wedson Almeida Filho
2023-04-11 02:45:33 -03:00
committed by Miguel Ojeda
parent 76d4bd591e
commit 6d20d629c6
4 changed files with 128 additions and 0 deletions
+1
View File
@@ -11,6 +11,7 @@ mod arc;
pub mod lock;
pub use arc::{Arc, ArcBorrow, UniqueArc};
pub use lock::mutex::Mutex;
/// Represents a lockdep class. It's a wrapper around C's `lock_class_key`.
#[repr(transparent)]