-
Notifications
You must be signed in to change notification settings - Fork 7
/
doc.go
20 lines (20 loc) · 955 Bytes
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// nsync package provides a set of primitives that are not provided by standard Go library.
//
// NamedMutex - a map of dynamically created mutexes by a referred name.
//
// OnceMutex - very similar to sync.Once, however, it is a mutex not a function wrapper.
//
// NamedOnceMutex - a map of dynamically created mutexes that can be acquired only once.
// However, once mutex unlocked it is removed from the map.
// So, next attempt to acquire this mutex will succeed.
//
// Semaphore - a semaphore primitive that can be acquired limited number of times.
//
// TryMutex - A mutex that provide ability to set a timeout to acquire a lock.
//
// ControlWaitGroup - a controlled goroutine executor that can limit the number concurrently running
// goroutines. Can help to solve a resource exhaustion problem.
//
// SyncFlag - an atomic flag that is wrapped by mutex. Mutex can be set/unset separately to prevent
// the flag from being set/unset.
package nsync