upmutex

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

README

What's upmutex?

Not much what's upmutex with you!

Performs checks on mutex upgrade/downgrade to see if another write lock was achieved during this time, result is bool.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UpgradeableMutex

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

UpgradeableMutex wraps a RWMutex and provides safe upgrading / downgrading by informing you whether a write lock was achieved in the brief swap time

func (*UpgradeableMutex) DowngradeLock

func (mu *UpgradeableMutex) DowngradeLock() bool

DowngradeLock downgrades a write to a read lock, returning success state as a bool

func (*UpgradeableMutex) Lock

func (mu *UpgradeableMutex) Lock()

Lock wraps the internal RWMutex, atomically storing the last write-lock time

func (*UpgradeableMutex) RLock

func (mu *UpgradeableMutex) RLock()

RLock exactly wraps the internal RWMutex

func (*UpgradeableMutex) RUnlock

func (mu *UpgradeableMutex) RUnlock()

RUnlock exactly wraps the internal RWMutex

func (*UpgradeableMutex) Unlock

func (mu *UpgradeableMutex) Unlock()

Unlock exactly wraps the internal RWMutex

func (*UpgradeableMutex) UpgradeLock

func (mu *UpgradeableMutex) UpgradeLock() bool

UpgradeLock upgrades a read to a write lock, returning success state as a bool

Jump to

Keyboard shortcuts

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