Documentation ¶
Overview ¶
Package sync implements primitives for syncronization between processes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DestroyMutex ¶
DestroyMutex permanently removes mutex with the given name.
func DestroySemaMutex ¶
DestroySemaMutex permanently removes mutex with the given name.
func DestroySpinMutex ¶
DestroySpinMutex removes a mutex object with the given name
Types ¶
type IPCLocker ¶
IPCLocker is a minimal interface, which must be satisfied by any synchronization primitive on any platform.
type SemaMutex ¶
type SemaMutex struct {
// contains filtered or unexported fields
}
SemaMutex is a semaphore-based mutex for unix.
func NewSemaMutex ¶
NewSemaMutex creates a new mutex.
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
Semaphore is a sysV semaphore.
func NewSemaphore ¶
NewSemaphore creates a new sysV semaphore with the given name. It generates a key from the name, and then calls NewSemaphoreKey.
func NewSemaphoreKey ¶
NewSemaphoreKey creates a new sysV semaphore for the given key.
key - object key. each semaphore object is identifyed by a unique key. flag - flag is a combination of open flags from 'os' package. perm - object's permission bits. initial - this value will be added to the semaphore's value, if it was created.
type SpinMutex ¶
type SpinMutex struct {
// contains filtered or unexported fields
}
SpinMutex is a synchronization object which performs busy wait loop.
func NewSpinMutex ¶
NewSpinMutex creates a new spin mutex.
name - object name. flag - flag is a combination of open flags from 'os' package. perm - object's permission bits.
func (*SpinMutex) Close ¶
Close indicates, that the object is no longer in use, and that the underlying resources can be freed.
func (SpinMutex) Lock ¶
func (spin SpinMutex) Lock()
Lock locks the mutex waiting in a busy loop if needed.