// ets_tracing: off
import * as Fiber from "../Fiber";
import * as FR from "../FiberRef";
import { pipe } from "../Function";
import * as O from "../Option";
import { fork } from "./core";
import { uninterruptibleMask } from "./interruption";
import * as zips from "./zips";
/**
 * Forks the effect into a new independent fiber, with the specified name.
 *
 * @ets_data_first forkAs_
 */

export function forkAs(name, __trace) {
  return self => forkAs_(self, name, __trace);
}
/**
 * Forks the effect into a new independent fiber, with the specified name.
 */

export function forkAs_(self, name, __trace) {
  return uninterruptibleMask(({
    restore
  }) => fork(zips.zipRight_(FR.set_(Fiber.fiberName, O.some(name)), restore(self)), __trace));
}
//# sourceMappingURL=forkAs.js.map