hal/application-lifecycle.lisp
Named release aggregation.
One named release step which signalled CONDITION.
All named failures from a completed release sequence.
Named release failures reported without replacing an active transfer.
D release step:P failed while unwinding~@[ A].~
:{~2%~A:~% ~A}
Call function as release step name, containing and recording any error.
Warn about failures without allowing warning policy to mask an unwind.
A global warning policy is allowed to promote warnings to errors, but cleanup reporting still cannot replace the condition already leaving.
Call function, then signal one release-error for all named failures.
An uncontained error from function remains primary. Any failures recorded
before that error are reported as a release-warning while it unwinds.
Run body and signal one release-error after every named step ran.
Call function and warn once about all of its named release failures.
Run body and non-fatally report every named release failure.
Call body-function and always run the named steps in cleanup-function.
If the body finishes, cleanup failures become one release-error. If the body
leaves by an error or another nonlocal transfer, cleanup failures are reported
without replacing that primary transfer. Every cleanup step expressed with
releasing is attempted in either case.
UNWIND-PROTECT with named, exhaustive, primary-preserving cleanup.
One-owner stop publication.
Base condition for invalid stop-controller operations.
Cannot ~A ~A from its nonblocking owner thread; request the ~ stop beside that thread instead.
An application attachment was offered after terminal teardown began.
A one-shot publication boundary around exactly one teardown execution.
The controller is a separate object owned by an application. One caller changes RUNNING to STOPPING and executes the teardown; every other blocking caller waits for the same result or condition. STOPPED is terminal, so no resource-owning body can run twice.
Make a one-shot stop controller named name.
blocking-thread-p, when supplied, is a quick predicate which is true on a
thread that may request a stop but must never own or wait for one.
Make a stop controller whose blocking path rejects canvas's native thread.
Return controller's synchronized RUNNING, STOPPING, or STOPPED state.
Return controller's published failure condition, or NIL.
Return a fresh list of controller's published normal values.
Call quick publication function iff controller is still running.
The controller lock remains held across function, making publication atomic
with the RUNNING to STOPPING transition. function and already-attached-p must
therefore neither block nor reenter controller. A true already-attached-p is
an idempotent success even during teardown and returns attachment without
republishing it. Otherwise, once stop has begun, signal
application-attachment-closed outside the lock so the caller can release its
unpublished attachment without deadlocking lifecycle inspection.
Run function as controller's sole teardown, or observe its published result.
A concurrent caller waits while the owner runs. A later caller receives the
same values or signals the same condition without running function again.
Wait for controller's existing owner and return its published outcome.
Request function as controller's teardown on one new worker thread.
Return true and the worker when this call reserved ownership, or NIL and NIL
when a stop was already requested or published. The worker contains any
failure after publishing it; wait-for-controlled-stop and synchronous callers
receive that exact condition.
The published condition is the asynchronous API; an unhandled worker error would only enter a debugger.
Failures collected by RELEASING in the current release scope.
Dynamic nesting depth of named release steps.
All named failures from a completed release sequence.
Named release failures reported without replacing an active transfer.
(name function)(name &body body)(failures primary-condition)(function)Call FUNCTION, then signal one RELEASE-ERROR for all named failures. An uncontained error from FUNCTION remains primary. Any failures recorded before that error are reported as a RELEASE-WARNING while it unwinds.
Logical disjunction of tests and raw truth values.
Test whether one compatible scalar is greater than another.
(&body body)(function &optional primary-condition)(&body body)(body-function cleanup-function)Call BODY-FUNCTION and always run the named steps in CLEANUP-FUNCTION. If the body finishes, cleanup failures become one RELEASE-ERROR. If the body leaves by an error or another nonlocal transfer, cleanup failures are reported without replacing that primary transfer. Every cleanup step expressed with RELEASING is…
(protected-form &body cleanup-forms)Base condition for invalid stop-controller operations.
An application attachment was offered after terminal teardown began.
A one-shot publication boundary around exactly one teardown execution. The controller is a separate object owned by an application. One caller changes RUNNING to STOPPING and executes the teardown; every other blocking caller waits for the same result or condition. STOPPED is terminal, so no resource-owning body…
(&key (name "application") blocking-thread-p)Make a one-shot stop controller named NAME. BLOCKING-THREAD-P, when supplied, is a quick predicate which is true on a thread that may request a stop but must never own or wait for one.
(canvas &key (name "canvas application"))A native destination with a lifetime and frame clock.
(canvas)Return true when the caller is CANVAS's native event/frame thread.
(controller)(controller)(controller)(controller function &key attachment already-attached-p)Call quick publication FUNCTION iff CONTROLLER is still running. The controller lock remains held across FUNCTION, making publication atomic with the RUNNING to STOPPING transition. FUNCTION and ALREADY-ATTACHED-P must therefore neither block nor reenter CONTROLLER. A true ALREADY-ATTACHED-P is an idempotent…
Logical conjunction of tests and raw truth values.
(controller operation)(controller result-values condition)(result-values condition)(controller function)(controller function)Run FUNCTION as CONTROLLER's sole teardown, or observe its published result. A concurrent caller waits while the owner runs. A later caller receives the same values or signals the same condition without running FUNCTION again.
(controller)(controller function &key thread-name)Request FUNCTION as CONTROLLER's teardown on one new worker thread. Return true and the worker when this call reserved ownership, or NIL and NIL when a stop was already requested or published. The worker contains any failure after publishing it; WAIT-FOR-CONTROLLED-STOP and synchronous callers receive that exact…
Logical negation of one test or raw truth value.
Honest, one-owner application teardown.