sync

package
v0.4.3-beta Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RWMutex

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

RWMutex provides locking functions, and an ability to detect and remove deadlocks.

func New

func New(maxLockTime time.Duration, callDepth int) *RWMutex

New takes a maxLockTime and returns a lock. The lock will never stay locked for more than maxLockTime, instead printing an error and unlocking after maxLockTime has passed.

func (*RWMutex) Lock

func (rwm *RWMutex) Lock() int

Lock will lock the RWMutex. The return value must be used as input when calling RUnlock.

func (*RWMutex) RLock

func (rwm *RWMutex) RLock() int

RLock will read lock the RWMutex. The return value must be used as input when calling RUnlock.

func (*RWMutex) RUnlock

func (rwm *RWMutex) RUnlock(id int)

RUnlock will read unlock the RWMutex. The return value of calling RLock must be used as input.

func (*RWMutex) Unlock

func (rwm *RWMutex) Unlock(id int)

Unlock will unlock the RWMutex. The return value of calling Lock must be used as input.

Jump to

Keyboard shortcuts

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