import { MigrationState } from './types.js';
export const waitUntilSleeping = async (workerState) => {
    await Atomics.waitAsync(workerState, 0, MigrationState.AWAKE).value;
};
export const setToAwake = (workerState, notify) => {
    workerState[0] = MigrationState.AWAKE;
    if (notify) {
        Atomics.notify(workerState, 0);
    }
};
export const setToSleep = (workerState) => {
    workerState[0] = MigrationState.SLEEP;
    Atomics.notify(workerState, 0);
    Atomics.wait(workerState, 0, MigrationState.SLEEP);
};
//# sourceMappingURL=utils.js.map