Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Acquire ¶
Acquire enters the semaphore a specified number of times, blocking only until ctx is done.
func GetCount ¶
func GetCount() int
GetCount returns current number of occupied entries in semaphore.
func New ¶
New initializes a new instance of the Semaphore, specifying the maximum number of concurrent entries.
func Release ¶
Release exits the semaphore a specified number of times and returns the previous count.
func SetParallel ¶
SetParallel sets a given number to the parallelism number.
Types ¶
Click to show internal directories.
Click to hide internal directories.