Conceptual
Login

Mutex

A mutual-exclusion lock: at most one thread holds it at a time, and acquiring it establishes a happens-before edge with the previous release, making the guarded data's writes visible. Rust's Mutex<T> owns its data, so access is only possible through the lock guard.

Questions this Concept answers

  • Why does the Rust design of placing the data inside the lock matter?