Semaphore

object Semaphore
Companion
class
class Object
trait Matchable
class Any

Type members

Classlikes

final class DeprecatedExtensions[F[_]](val source: Semaphore[F]) extends AnyVal

Value members

Concrete methods

def apply[F[_]](provisioned: Long, ps: PaddingStrategy)(F: OrElse[Concurrent[F], Async[F]], cs: ContextShift[F]): F[Semaphore[F]]

Builds a Semaphore instance.

Builds a Semaphore instance.

Value Params
F

is the type class instance required to make Semaphore work, can be either Concurrent or Async for extra flexibility

cs

is a ContextShift instance required in order to introduce async boundaries after successful acquire operations, for safety

provisioned

is the number of permits initially available

ps

is an optional padding strategy for avoiding the "false sharing problem", a common JVM effect when multiple threads read and write in shared variables

@UnsafeBecauseImpure
def unsafe[F[_]](provisioned: Long, ps: PaddingStrategy)(F: OrElse[Concurrent[F], Async[F]], cs: ContextShift[F]): Semaphore[F]

Builds a Semaphore instance.

Builds a Semaphore instance.

'''Unsafe warning:''' this violates referential transparency. Use with care, prefer the pure Semaphore.apply.

Value Params
F

is the type class instance required to make Semaphore work, can be either Concurrent or Async for extra flexibility

cs

is a ContextShift instance required in order to introduce async boundaries after successful acquire operations, for safety

provisioned

is the number of permits initially available

ps

is an optional padding strategy for avoiding the "false sharing problem", a common JVM effect when multiple threads read and write in shared variables