Crate for locking by name

Here's another solution using thread::park.

1 Like

OK, like this.

That's another 2-stage solution. But if there's no other way...

My second post is not a 2-stage solution.

True, but now we're getting into writing a custom CPU dispatcher.

I gather there's no way to do

let lok1 = locks.get("abc");
let _guard1 = lok1.lock();

in one statement.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.