(n: number)
| 309 | readonly withPermit = this.withPermits(1) |
| 310 | |
| 311 | withPermitsIfAvailable(n: number) { |
| 312 | return <A, E, R>(self: Effect.Effect<A, E, R>) => |
| 313 | internal.uninterruptibleMask((restore) => { |
| 314 | if (this.free < n) return internal.succeedNone |
| 315 | this.taken += n |
| 316 | return internal.onExitPrimitive(restore(internal.asSome(self)), () => { |
| 317 | this.releaseUnsafe(internal.getCurrentFiber()!, n) |
| 318 | return undefined |
| 319 | }, true) |
| 320 | }) |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | /** |
nothing calls this directly
no test coverage detected