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
| 3679 | })) |
| 3680 | |
| 3681 | const completeRace = <A2, A3, E2, E3, R, R1, R2, R3>( |
| 3682 | winner: Fiber.RuntimeFiber<any, any>, |
| 3683 | loser: Fiber.RuntimeFiber<any, any>, |
| 3684 | cont: (winner: Fiber.RuntimeFiber<any, any>, loser: Fiber.RuntimeFiber<any, any>) => Effect.Effect<any, any, any>, |
| 3685 | ab: MRef.MutableRef<boolean>, |
| 3686 | cb: (_: Effect.Effect<A2 | A3, E2 | E3, R | R1 | R2 | R3>) => void |
| 3687 | ): void => { |
| 3688 | if (MRef.compareAndSet(true, false)(ab)) { |
| 3689 | cb(cont(winner, loser)) |
| 3690 | } |
| 3691 | } |
| 3692 | |
| 3693 | /** @internal */ |
| 3694 | export const ensuring: { |
Tested by
no test coverage detected