Entropic 2.14.3
Local-first agentic inference engine
Loading...
Searching...
No Matches
entropic::RunCancelScope Class Reference

RAII publication of one run's cancel token to its own thread. More...

#include <entropic/types/run_scope.h>

Public Member Functions

 RunCancelScope (std::atomic< bool > *token)
 Publish token as this thread's run cancel token.
 
 ~RunCancelScope ()
 Restore the previously installed token.
 
 RunCancelScope (const RunCancelScope &)=delete
 
RunCancelScope & operator= (const RunCancelScope &)=delete
 

Detailed Description

RAII publication of one run's cancel token to its own thread.

Restores the previous value on destruction rather than clearing it, so a nested scope (a child delegation loop inside a parent turn) cannot orphan the parent's token when it unwinds.

Returns
An RAII guard binding this thread to token until it goes out of scope, at which point the previous token is restored. @req REQ-LOOP-006
Version
2.13.0 [reviewed]

Definition at line 98 of file run_scope.h.

Constructor & Destructor Documentation

◆ RunCancelScope()

entropic::RunCancelScope::RunCancelScope ( std::atomic< bool > *  token)
explicit

Publish token as this thread's run cancel token.

gh#158 RAII enter — see header.

Non-const since gh#158's audit pass: cancel_current_run() stops the run from inside it, which is a write.

Parameters
tokenBorrowed cancel flag; nullptr installs "no token".
Returns
n/a (constructor). @req REQ-LOOP-006
Version
2.13.0 [reviewed]
Parameters
tokenBorrowed cancel flag; nullptr installs "no token".
Returns
n/a (constructor). @req REQ-LOOP-006
Version
2.13.0 [reviewed]

Definition at line 57 of file run_scope.cpp.

◆ ~RunCancelScope()

entropic::RunCancelScope::~RunCancelScope ( )

Restore the previously installed token.

gh#158 RAII exit — see header.

Returns
n/a (destructor). @req REQ-LOOP-006
Version
2.13.0

Definition at line 82 of file run_scope.cpp.


The documentation for this class was generated from the following files: