syncutil

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2017 License: Apache-2.0 Imports: 2 Imported by: 5,572

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mutex

type Mutex struct {
	// contains filtered or unexported fields
}

A Mutex is a mutual exclusion lock.

func (*Mutex) AssertHeld

func (m *Mutex) AssertHeld()

AssertHeld may panic if the mutex is not locked (but it is not required to do so). Functions which require that their callers hold a particular lock may use this to enforce this requirement more directly than relying on the race detector.

Note that we do not require the lock to be held by any particular thread, just that some thread holds the lock. This is both more efficient and allows for rare cases where a mutex is locked in one thread and used in another.

func (*Mutex) Lock

func (m *Mutex) Lock()

Lock implements sync.Locker.

func (*Mutex) Unlock

func (m *Mutex) Unlock()

Unlock implements sync.Locker.

type RWMutex

type RWMutex struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

An RWMutex is a reader/writer mutual exclusion lock.

func (*RWMutex) AssertHeld

func (m *RWMutex) AssertHeld()

AssertHeld may panic if the mutex is not locked for writing (but it is not required to do so). Functions which require that their callers hold a particular lock may use this to enforce this requirement more directly than relying on the race detector.

Note that we do not require the lock to be held by any particular thread, just that some thread holds the lock. This is both more efficient and allows for rare cases where a mutex is locked in one thread and used in another.

func (*RWMutex) Lock

func (m *RWMutex) Lock()

Lock implements sync.Locker.

func (*RWMutex) Unlock

func (m *RWMutex) Unlock()

Unlock implements sync.Locker.

Jump to

Keyboard shortcuts

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