3 ms·
Here's the mutex source: https://golang.org/src/sync/mutex.go https://golang.org/src/sync/mutex.go . The fast path is just a CAS, which of course is going to be
by millstone 11y ago
Here's the mutex source: https://golang.org/src/sync/mutex.go https://golang.org/src/sync/mutex.go . The fast path is just a CAS, which of course is going to be fast. But it's also important to know how it performs under contention.