sync

package
v0.0.0-...-b9f62ee Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2016 License: MIT Imports: 11 Imported by: 0

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 Enable

func Enable()

func PrintLockTimes

func PrintLockTimes(w io.Writer)

Types

type Cond

type Cond struct {
	sync.Cond
}

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 {
	sync.WaitGroup
}

Jump to

Keyboard shortcuts

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