Versions in this module Expand all Collapse all v1 v1.0.0 Oct 3, 2026 Changes in this version + var ErrAborted = errors.New("nsync: control wait group aborted") + type ControlWaitGroup struct + func NewControlWaitGroup(poolSize int) *ControlWaitGroup + func (cwg *ControlWaitGroup) Abort() + func (cwg *ControlWaitGroup) Do(userFunc func()) bool + func (cwg *ControlWaitGroup) DoContext(ctx context.Context, userFunc func()) error + func (cwg *ControlWaitGroup) Wait() + func (cwg *ControlWaitGroup) WaitContext(ctx context.Context) error + func (cwg *ControlWaitGroup) Waiting() int + func (cwg *ControlWaitGroup) Working() int + type NamedMutex struct + func NewNamedMutex() *NamedMutex + func (nm *NamedMutex) Lock(name string) + func (nm *NamedMutex) LockContext(ctx context.Context, name string) error + func (nm *NamedMutex) TryLock(name string) bool + func (nm *NamedMutex) TryLockTimeout(name string, timeout time.Duration) bool + func (nm *NamedMutex) Unlock(name string) + type NamedOnceMutex struct + func NewNamedOnceMutex() *NamedOnceMutex + func (nom *NamedOnceMutex) Lock(key any) bool + func (nom *NamedOnceMutex) LockContext(ctx context.Context, key any) (bool, error) + func (nom *NamedOnceMutex) Unlock(key any) + type OnceMutex struct + func NewOnceMutex() *OnceMutex + func (om *OnceMutex) Lock() bool + func (om *OnceMutex) LockContext(ctx context.Context) (bool, error) + func (om *OnceMutex) Unlock() + type Semaphore struct + func NewSemaphore(value int) *Semaphore + func (s *Semaphore) Acquire() + func (s *Semaphore) AcquireContext(ctx context.Context) error + func (s *Semaphore) Release() + func (s *Semaphore) TryAcquire() bool + func (s *Semaphore) TryAcquireTimeout(d time.Duration) bool + func (s *Semaphore) Value() int + type SyncFlag struct + func (bf *SyncFlag) IsSet() bool + func (bf *SyncFlag) IsUnset() bool + func (bf *SyncFlag) Set() + func (bf *SyncFlag) Unset() + type TryMutex struct + func NewTryMutex() *TryMutex + func (tm TryMutex) Lock() + func (tm TryMutex) LockContext(ctx context.Context) error + func (tm TryMutex) TryLock() bool + func (tm TryMutex) TryLockTimeout(timeout time.Duration) bool + func (tm TryMutex) Unlock()