Skip to content

Siryu/MutexBuffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MutexBuffer

Allow for a single mutex to have a buffer that allows for more than one lock

This allows for a certain number of go routines to access the code at a time

How to Use

package main

import (
  "github.com/Siryu/MutexBuffer"
)

func main() {
// create reference to mutex
// set the size you want the buffer to be
mutex := mutexBuffer.New(3)
// lock a mutex
mutex.Lock()

// insert the code here you want to be restricted to

// unlock a mutex
mutex.Unlock()
}

License

MIT

About

Allow for a single mutex to have a buffer

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages