import * as tracing_1 from "../../Tracing";
const fileName_1 = "(@effect-ts/system): _src/Support/Scheduler/index.ts";
import { DoublyLinkedList } from "../DoublyLinkedList";
let isRunning = false;
const tasks = /*#__PURE__*/new DoublyLinkedList();
export const defaultScheduler = thunk => {
  tasks.add(thunk);

  if (!isRunning) {
    isRunning = true;
    Promise.resolve().then(() => {
      while (tasks.length > 0) {
        tasks.shift()();
      }

      isRunning = false;
    });
  }
};
//# sourceMappingURL=index.js.map