Skip to content

Commit 43dace9

Browse files
authored
Mutex<Work>Work (#1156)
I missed this one in #1132, but it's another case where the mutex is unnecessary. Exclusive (or shared + immutable) borrowing of the `Work` is guaranteed by the borrow checker, because the `struct Work` is exclusively owned by the `Downstairs`. Therefore, I replaced `Downstairs::work_lock` with `Downstairs::work` and `Downstairs::work_mut`, retaining the same checks for whether the upstairs is active. The relevant portion of new code is [here](https://github.com/oxidecomputer/crucible/compare/main...mkeeter:more-mutex-removal?expand=1#diff-ccb2591a32a7a66c4c4cbb1125ce4e72d2d1b2f10e805991a30f9e8643e3d954R1945-R1964); most everything else is boilerplate (since like #1132, removing the async borrow changes other functions from `async` to sync).
1 parent a1f3207 commit 43dace9

File tree

1 file changed

+204
-273
lines changed

1 file changed

+204
-273
lines changed

0 commit comments

Comments
 (0)