Skip to content

Glossary: System Design Basics in Go

mutex

Also written: sync.Mutex, lock

A lock in Go: `Lock()` waits until nobody else holds it and `Unlock()` frees it, so one goroutine at a time runs the code in between. It protects shared maps and makes a check-and-change atomic.

Where the book teaches it

Related terms

atomicrace conditiongoroutinedefer