Skip to content
forked from jirenius/keylock

Go package keylock provides mutex locking based on a key string.

License

Notifications You must be signed in to change notification settings

mayouzi/keylock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Key Lock for Go

License MIT Report Card Build Status Reference

A Go package that provides mutex locking based on a key string.

Installation

go get github.com/jirenius/keylock

Usage

    // Zero value of KeyLock is ready to use
    kl := &KeyLock{}

    // Lock key foo
    kl.Lock("foo")
    defer kl.Unlock("foo")

    // Read lock key bar
    kl.RLock("bar")
    defer kl.RUnlock("bar")

About

Go package keylock provides mutex locking based on a key string.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%