Function
completeRace
(
winner: Fiber.RuntimeFiber<any, any>,
loser: Fiber.RuntimeFiber<any, any>,
cont: (winner: Fiber.RuntimeFiber<any, any>, loser: Fiber.RuntimeFiber<any, any>) => Effect.Effect<any, any, any>,
ab: MRef.MutableRef<boolean>,
cb: (_: Effect.Effect<A2 | A3, E2 | E3, R | R1 | R2 | R3>) => void
)
Source from the content-addressed store, hash-verified
| 3689 | })) |
| 3690 | |
| 3691 | const completeRace = <A2, A3, E2, E3, R, R1, R2, R3>( |
| 3692 | winner: Fiber.RuntimeFiber<any, any>, |
| 3693 | loser: Fiber.RuntimeFiber<any, any>, |
| 3694 | cont: (winner: Fiber.RuntimeFiber<any, any>, loser: Fiber.RuntimeFiber<any, any>) => Effect.Effect<any, any, any>, |
| 3695 | ab: MRef.MutableRef<boolean>, |
| 3696 | cb: (_: Effect.Effect<A2 | A3, E2 | E3, R | R1 | R2 | R3>) => void |
| 3697 | ): void => { |
| 3698 | if (MRef.compareAndSet(true, false)(ab)) { |
| 3699 | cb(cont(winner, loser)) |
| 3700 | } |
| 3701 | } |
| 3702 | |
| 3703 | /** @internal */ |
| 3704 | export const ensuring: { |
Tested by
no test coverage detected