Packages

object Semaphore

Source
Semaphore.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Semaphore
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit final class DeprecatedExtensions[F[_]] extends AnyVal

Value Members

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

    Builds a Semaphore instance.

    Builds a Semaphore instance.

    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

    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

  2. def unsafe[F[_]](provisioned: Long, ps: PaddingStrategy = NoPadding)(implicit 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.

    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

    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

    Annotations
    @UnsafeBecauseImpure()