kutex

package module
v0.0.0-...-93b41fc Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 2 Imported by: 0

README

Kutex GoDoc

Kutex = key + mutex

Import
import "github.com/4vn/kutex"
Usage
ku := kutex.New(1000)
userId := "gaia"
ku.Lock(userId)
// Do something
ku.Unlock(userId)
License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kutex

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

func New

func New(size uint) *Kutex

New creates a Kutex instance.

func (*Kutex) Lock

func (me *Kutex) Lock(key string)

Lock waits to acquire lock.

func (*Kutex) Unlock

func (me *Kutex) Unlock(key string)

Unlock release the lock.

Jump to

Keyboard shortcuts

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