import * as tsplus_module_1 from "@effect/core/stm/TSemaphore/operations/withPermits";
import { concreteSemaphore } from "@effect/core/io/Semaphore/operations/_internal/SemaphoreInternal";
/**
 * Executes the specified effect, acquiring the specified number of permits
 * immediately before the effect begins execution and releasing them
 * immediately after the effect completes execution, whether by success,
 * failure, or interruption.
 *
 * @tsplus fluent ets/Semaphore withPermits
 */

export function withPermits_(self, permits, __tsplusTrace) {
  return effect => {
    void 0;
    return tsplus_module_1.withPermits_(self.semaphore, permits, __tsplusTrace)(effect);
  };
}
/**
 * Executes the specified effect, acquiring the specified number of permits
 * immediately before the effect begins execution and releasing them
 * immediately after the effect completes execution, whether by success,
 * failure, or interruption.
 *
 * @tsplus static ets/Semaphore/Aspects withPermits
 */

export const withPermits = (permits, __tsplusTrace) => self => withPermits_(self, permits, __tsplusTrace);
//# sourceMappingURL=withPermits.mjs.map