Macaulay2 Engine
Loading...
Searching...
No Matches
interrupted.hpp File Reference

system_interrupted() — thread-safe polling predicate for Ctrl+C handling. More...

Go to the source code of this file.

Functions

bool system_interrupted ()

Detailed Description

system_interrupted() — thread-safe polling predicate for Ctrl+C handling.

Note
AI-generated documentation. Verify against the source before relying on it.

Exposes the single global function system_interrupted(), which reads the thread-local atomic field interrupts_interruptedFlag defined in the system supervisor. The body (in interrupted.cpp) is a one-line wrapper around the interrupted() macro that pulls the thread-local out of the supervisor's THREADLOCAL / atomic_field plumbing; the header exists so callers see only the abstract predicate without having to pull in system/supervisor.hpp and its atomic-primitive support. Engine inner loops poll the flag and bail out by returning COMP_INTERRUPTED (defined in interface/computation.h) when it is set, the chain that delivers a user Ctrl+C to a running computation.

Polled by long-running engine loops — the GB and resolution drivers, NAG path tracking, F4 matrix passes, dense linear-algebra routines — as the cooperative cancellation handshake matching the stop-condition machinery declared in comp.hpp.

See also
comp.hpp
interface/computation.h

Definition in file interrupted.hpp.