gsync

package
v0.0.0-...-f3abbe6 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package xmutex provides the implementation of a mutex that implements an efficient TryLock function in addition to Lock and Unlock.

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
}

Mutex is a mutual exclusion primitive that implements TryLock in addition to Lock and Unlock.

func (*Mutex) Init

func (m *Mutex) Init()

Init initializes the mutex.

func (*Mutex) Lock

func (m *Mutex) Lock()

Lock acquires the mutex. If it is currently held by another goroutine, Lock will wait until it has a chance to acquire it.

func (*Mutex) TryLock

func (m *Mutex) TryLock() bool

TryLock attempts to acquire the mutex without blocking. If the mutex is currently held by another goroutine, it fails to acquire it and returns false.

func (*Mutex) Unlock

func (m *Mutex) Unlock()

Unlock releases the mutex.

type RWMutex

type RWMutex drwmutex.DRWMutex

func (RWMutex) Lock

func (rm RWMutex) Lock()

func (RWMutex) RLock

func (rm RWMutex) RLock()

func (RWMutex) Unlock

func (rm RWMutex) Unlock()

Jump to

Keyboard shortcuts

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