Builds a Semaphore instance.
Builds a Semaphore instance.
is the number of permits initially available
is an optional padding strategy for avoiding the "false sharing problem", a common JVM effect when multiple threads read and write in shared variables
is the type class instance required to make Semaphore
work,
can be either Concurrent
or Async
for extra flexibility
is a ContextShift
instance required in order to introduce
async boundaries after successful acquire
operations, for safety
Builds a Semaphore instance.
Builds a Semaphore instance.
Unsafe warning: this violates referential transparency. Use with care, prefer the pure Semaphore.apply.
is the number of permits initially available
is an optional padding strategy for avoiding the "false sharing problem", a common JVM effect when multiple threads read and write in shared variables
is the type class instance required to make Semaphore
work,
can be either Concurrent
or Async
for extra flexibility
is a ContextShift
instance required in order to introduce
async boundaries after successful acquire
operations, for safety