Locking
Locking
Posted Sep 24, 2024 6:58 UTC (Tue) by roc (subscriber, #30627)In reply to: Locking by viro
Parent article: Resources for learning Rust for kernel development
> How would the compiler verify that a call you've added in the area under mutex will not lead to the same mutex being grabbed? If the answer is "it won't", you need to be able to see that without its assistance. The lack of explicit unlock makes that much harder to see.
As noted in this article, the kernel is already using scoped guards in C. E.g.:
https://github.com/torvalds/linux/blob/abf2050f51fdca0fd1...
so it's too late to require explicit "unlock".
