This section is empty.


This section is empty.


This section is empty.


type Mutex

type Mutex struct {
	// contains filtered or unexported fields

    Mutex is a struct that keeps track of a set of mutexes with a given ID. It can be used for making sure only one goroutine gets given the mutex per ID.

    func NewMutex

    func NewMutex() *Mutex

      NewMutex creates a new Mutex.

      func (*Mutex) Lock

      func (c *Mutex) Lock(id uint64)

        Lock locks the mutex by the given ID. If the mutex is already locked by this ID, Lock blocks until the mutex is available.

        func (*Mutex) Unlock

        func (c *Mutex) Unlock(id uint64)

          Unlock unlocks the mutex by the given ID. It is a run-time error if the mutex is not locked by the ID on entry to Unlock.

          Source Files