Version: v0.0.0-...-8eb0ba3 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2016 License: MIT Imports: 11 Imported by: 0



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.



This section is empty.


This section is empty.


func Enable

func Enable()

func PrintLockTimes

func PrintLockTimes(w io.Writer)


type Cond

type Cond struct {

type Mutex

type Mutex struct {
	// contains filtered or unexported fields

func (*Mutex) Lock

func (m *Mutex) Lock()

func (*Mutex) Unlock

func (m *Mutex) Unlock()

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.

func (*RWMutex) Lock

func (me *RWMutex) Lock()

func (*RWMutex) RLock

func (me *RWMutex) RLock()

func (*RWMutex) RUnlock

func (me *RWMutex) RUnlock()

func (*RWMutex) Unlock

func (me *RWMutex) Unlock()

type WaitGroup

type WaitGroup struct {

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL