keymu

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package keymu provides a map of mutexes that allows users to lock and unlock single keys in the data structure. This functionality can be used to provide key-based "transactions" in the form of exclusive locks on a given key.

See: https://stackoverflow.com/questions/40931373/how-to-gc-a-map-of-mutexes-in-go

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
}

TODO: create an RWMutex

func New

func New() *Mutex

func (*Mutex) Len

func (m *Mutex) Len() int

func (*Mutex) Lock

func (m *Mutex) Lock(key any) Unlocker

type Unlocker

type Unlocker interface {
	Unlock()
}

Jump to

Keyboard shortcuts

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