import * as tsplus_module_1 from "@effect/core/io/Scope/operations/extend";
import * as tsplus_module_2 from "@effect/core/io/Scope/operations/close";
import * as tsplus_module_3 from "@effect/core/io/Scope/operations/addFinalizerExit";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/flatMap";
import * as tsplus_module_5 from "@effect/core/io/Scope/operations/parallel";
import * as tsplus_module_6 from "@effect/core/io/Effect/operations/scope";
/**
 * @tsplus static ets/Effect/Ops parallelFinalizers
 */

export function parallelFinalizers(effect, __tsplusTrace) {
  return tsplus_module_4.flatMap_(tsplus_module_6.scope, outerScope => tsplus_module_4.flatMap_(tsplus_module_5.parallel(__tsplusTrace), innerScope => tsplus_module_4.flatMap_(tsplus_module_3.addFinalizerExit_(outerScope, exit => tsplus_module_2.close_(innerScope, () => exit)), () => tsplus_module_1.extend_(innerScope, effect), __tsplusTrace), __tsplusTrace), __tsplusTrace);
}
//# sourceMappingURL=parallelFinalizers.mjs.map