Skip to content

EntropyEngine::Core::Concurrency::WorkContractGroup::ContractSlot

EntropyEngine::Core::Concurrency::WorkContractGroup::ContractSlot

Section titled “EntropyEngine::Core::Concurrency::WorkContractGroup::ContractSlot”

Internal storage for a single work contract. More…

Name
std::function< void()>work
Work function.
std::atomic< ContractState >state
Current lifecycle state.
std::atomic< uint32_t >nextFree
Next free slot.
std::atomic< uint32_t >generation
Handle validation counter.
ExecutionTypeexecutionType
Execution context (main/any thread).
struct EntropyEngine::Core::Concurrency::WorkContractGroup::ContractSlot;

Internal storage for a single work contract.

Each slot represents one work contract and tracks its lifecycle through atomic state transitions. The generation counter prevents use-after-free by invalidating old handles when slots are reused.

std::function< void()> work;

Work function.

std::atomic< ContractState > state {ContractState::Free};

Current lifecycle state.

std::atomic< uint32_t > nextFree {INVALID_INDEX};

Next free slot.

std::atomic< uint32_t > generation {1};

Handle validation counter.

ExecutionType executionType {ExecutionType::AnyThread};

Execution context (main/any thread).


Updated on 2026-01-26 at 17:14:35 -0500