Description
Adds Mutex-like behavior to Ruby objects through a mixin. It is useful when shared objects need synchronized access across threads without wrapping every operation in a separate lock object.
Locking can create deadlocks or hide performance problems. Keep critical sections small, define lock ordering, and test concurrent paths under realistic load.