of


Description:

public static Result<Semaphore,Error> of (int permits)

Creates semaphore with initial permits.

Parameters:

permits

initial permit count.

Returns:

Result.ok(semaphore), or Result.error(SemaphoreError.INVALID_ARGUMENT) when permits is negative.