Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

starboard-nz/lockunique

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LockUnique

LockUnique implements locking by a unique ID. This is useful to perform tasks for many IDs in parallel but restricting to one task per ID.

The ID can be any comparable type, LockUnique uses generics.

Example

	l := lockunique.NewLockUnique[int32]()

        id := int32(123)

        l.Lock(id)
        do_something(id)
        err := l.Unlock(id)
        if err != nil {
                // id was not locked
        }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages