go4.org: go4.org/syncutil/syncdebug Index | Files

package syncdebug

import "go4.org/syncutil/syncdebug"

Package syncdebug contains facilities for debugging synchronization problems.


Package Files


func GoroutineID Uses

func GoroutineID() int64

GoroutineID returns the current goroutine's ID. Use of this function is almost always a terrible idea. It is also very slow. GoroutineID is intended only for debugging. In particular, it is used by syncutil.

type RWMutexTracker Uses

type RWMutexTracker struct {
    // contains filtered or unexported fields

RWMutexTracker is a sync.RWMutex that tracks who owns the current exclusive lock. It's used for debugging deadlocks.

func (*RWMutexTracker) Holder Uses

func (m *RWMutexTracker) Holder() string

Holder returns the stack trace of the current exclusive lock holder's stack when it acquired the lock (with Lock). It returns the empty string if the lock is not currently held.

func (*RWMutexTracker) Lock Uses

func (m *RWMutexTracker) Lock()

func (*RWMutexTracker) RLock Uses

func (m *RWMutexTracker) RLock()

func (*RWMutexTracker) RUnlock Uses

func (m *RWMutexTracker) RUnlock()

func (*RWMutexTracker) Unlock Uses

func (m *RWMutexTracker) Unlock()

Package syncdebug imports 8 packages (graph). Updated 2018-01-04. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).