import * as tsplus_module_1 from "@effect/core/io/Effect/operations/done";
import * as tsplus_module_2 from "@effect/core/io/Fiber/operations/await";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/flatMap";
import * as tsplus_module_4 from "@effect/core/io/Fiber/operations/inheritRefs";
import * as tsplus_module_5 from "@effect/core/io/Effect/operations/zipLeft";
/**
 * Joins the fiber, which suspends the joining fiber until the result of the
 * fiber has been determined. Attempting to join a fiber that has erred will
 * result in a catchable error. Joining an interrupted fiber will result in an
 * "inner interruption" of this fiber, unlike interruption triggered by
 * another fiber, "inner interruption" can be caught and recovered.
 *
 * @tsplus fluent ets/Fiber join
 * @tsplus fluent ets/RuntimeFiber join
 */

export function join(self, __tsplusTrace) {
  return tsplus_module_5.zipLeft_(tsplus_module_3.flatMap_(tsplus_module_2._await(self, __tsplusTrace), exit => tsplus_module_1.done(() => exit, __tsplusTrace), __tsplusTrace), () => tsplus_module_4.inheritRefs(self, __tsplusTrace), __tsplusTrace);
}
//# sourceMappingURL=join.mjs.map