LockedBy in kernel::sync
Normally a lock wraps the data it protects, but sometimes the lock lives in a parent structure while the data it guards sits inside the children. LockedBy is a wrapper for exactly that case: it remem…
Sometimes one lock protects data that lives somewhere else: a list held in a parent structure guards fields inside each of its children. Putting the data inside the lock is then impossible, so the kernel crate offers a wrapper that names the lock that protects it and will only hand out access when you present that lock's guard. The rule that used to be a comment saying must hold the parent lock becomes something the compiler checks. It is how you keep the data-inside-the-lock guarantee when the structure of your driver will not allow literal nesting.
Normally a lock wraps the data it protects, but sometimes the lock lives in a parent structure while the data it guards sits inside the children. LockedBy is a wrapper for exactly that case: it remem…