var Opts … type Cond … type Locker … type Once … type Pool … type WaitGroup … var NewCond … type Mutex … // Lock locks the mutex. // If the lock is already in use, the calling goroutine // blocks until the mutex is available. // // Unless deadlock detection is disabled, logs potential deadlocks to Opts.LogBuf, // calling Opts.OnPotentialDeadlock on each occasion. func (m *Mutex) Lock() { … } // Unlock unlocks the mutex. // It is a run-time error if m is not locked on entry to Unlock. // // A locked Mutex is not associated with a particular goroutine. // It is allowed for one goroutine to lock a Mutex and then // arrange for another goroutine to unlock it. func (m *Mutex) Unlock() { … } type RWMutex … // Lock locks rw for writing. // If the lock is already locked for reading or writing, // Lock blocks until the lock is available. // To ensure that the lock eventually becomes available, // a blocked Lock call excludes new readers from acquiring // the lock. // // Unless deadlock detection is disabled, logs potential deadlocks to Opts.LogBuf, // calling Opts.OnPotentialDeadlock on each occasion. func (m *RWMutex) Lock() { … } // Unlock unlocks the mutex for writing. It is a run-time error if rw is // not locked for writing on entry to Unlock. // // As with Mutexes, a locked RWMutex is not associated with a particular // goroutine. One goroutine may RLock (Lock) an RWMutex and then // arrange for another goroutine to RUnlock (Unlock) it. func (m *RWMutex) Unlock() { … } // RLock locks the mutex for reading. // // Unless deadlock detection is disabled, logs potential deadlocks to Opts.LogBuf, // calling Opts.OnPotentialDeadlock on each occasion. func (m *RWMutex) RLock() { … } // RUnlock undoes a single RLock call; // it does not affect other simultaneous readers. // It is a run-time error if rw is not locked for reading // on entry to RUnlock. func (m *RWMutex) RUnlock() { … } // RLocker returns a Locker interface that implements // the Lock and Unlock methods by calling RLock and RUnlock. func (m *RWMutex) RLocker() sync.Locker { … } func (m *RWMutex) Locker() sync.Locker { … } func preLock(stack []uintptr, p interface{ … } func postLock(stack []uintptr, p interface{ … } func postUnlock(p interface{ … } func lock(lockFn func(), ptr interface{ … } type lockOrder … type stackGID … type beforeAfter … type ss … var lo … func newLockOrder() *lockOrder { … } func (l *lockOrder) postLock(stack []uintptr, p interface{ … } func (l *lockOrder) preLock(stack []uintptr, p interface{ … } func (l *lockOrder) postUnlock(p interface{ … } type rlocker … func (r *rlocker) Lock() { … } func (r *rlocker) Unlock() { … } type locker … func (r *locker) Lock() { … } func (r *locker) Unlock() { … } // Under lo.mu Locked. func (l *lockOrder) other(ptr interface{ … } const header …