Documentation ¶
Overview ¶
Package sync records the stack when locks are taken, and when locks are blocked on and exports them as pprof profiles "lockHolders" and "lockBlockers". if "net/http/pprof" is imported, you can view them at /debug/pprof/ on the default HTTP muxer.
The API mirrors that of stdlib "sync". The package can be imported in place of "sync", and is enabled by setting the envvar PPROF_SYNC non-empty.
Note that currently RWMutex is treated like a Mutex when the package is enabled.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintLockTimes ¶
Types ¶
type RWMutex ¶
type RWMutex struct {
// contains filtered or unexported fields
}
This RWMutex's RLock and RUnlock methods don't allow shared reading because there's no way to determine what goroutine has stopped holding the read lock when RUnlock is called. So for debugging purposes, it's just like Mutex.