rust: sync: introduce `Lock` and `Guard`
authorWedson Almeida Filho <walmeida@microsoft.com>
Tue, 11 Apr 2023 05:45:32 +0000 (02:45 -0300)
committerMiguel Ojeda <ojeda@kernel.org>
Fri, 21 Apr 2023 22:19:42 +0000 (00:19 +0200)
commit76d4bd591e1101df69c44c819041e374c63f1194
treece071e007936453452d1d69f8d6a711a1003fdeb
parent6ea5aa08857a81be7114b3c21d6aa6db0bc95f99
rust: sync: introduce `Lock` and `Guard`

They are generic Rust implementations of a lock and a lock guard that
contain code that is common to all locks. Different backends will be
introduced in subsequent commits.

Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Suggested-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Link: https://lore.kernel.org/r/20230411054543.21278-2-wedsonaf@gmail.com
[ Fixed typo. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/sync.rs
rust/kernel/sync/lock.rs [new file with mode: 0644]