syncdebug

package
v0.0.0-...-2148625 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package syncdebug contains facilities for debugging synchronization problems.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoroutineID

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.

Types

type RWMutexTracker

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

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

func (m *RWMutexTracker) Lock()

func (*RWMutexTracker) RLock

func (m *RWMutexTracker) RLock()

func (*RWMutexTracker) RUnlock

func (m *RWMutexTracker) RUnlock()

func (*RWMutexTracker) Unlock

func (m *RWMutexTracker) Unlock()

Jump to

Keyboard shortcuts

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