mutex-break

xod/mutex/mutex-break

Forces mutex release/unlock regardless of who owns it currently.
mutex-break
@/mutex-break
Forces mutex release/unlock regardless of who owns it currently.
DOpulse
Do break
MUX@/mutex
The mutex
mutex-break
DO
MUX
DONE
MUX'
MUX'@/mutex
The mutex
DONEpulse
Fires when the mutex is free. In practice immediatelly after `DO`.

C++ implementation

#pragma XOD evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_DO

node {
    void evaluate(Context ctx) {
        auto mux = getValue<input_MUX>(ctx);

        if (isSettingUp()) {
            // Short-circuit RES and RES'
            emitValue<output_MUXU0027>(ctx, mux);
        }

        if (!isInputDirty<input_DO>(ctx))
            return;

        mux->forceUnlock();
        emitValue<output_DONE>(ctx, 1);
    }
}