Foundation
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Foundation::Core::ParallelForAsyncJob< Fn > Struct Template Referencefinal

One worker of a ParallelForAsyncState: drains the shared cursor and, when it is the last running worker, satisfies the promise and frees the shared state. More...

#include <ThreadPool.hpp>

Inheritance diagram for Foundation::Core::ParallelForAsyncJob< Fn >:
Foundation::Core::Job

Public Member Functions

 ParallelForAsyncJob (ParallelForAsyncState< Fn > *s)
 
void Execute (size_t workerId) noexcept override
 
- Public Member Functions inherited from Foundation::Core::Job
virtual ~Job ()=default
 

Public Attributes

ParallelForAsyncState< Fn > * state {nullptr}
 

Detailed Description

template<typename Fn>
struct Foundation::Core::ParallelForAsyncJob< Fn >

One worker of a ParallelForAsyncState: drains the shared cursor and, when it is the last running worker, satisfies the promise and frees the shared state.

Note
Each instance is owned by the pool queue (destroyed after a single Execute). Only the shared state is reference-counted via ParallelForAsyncState::remaining.

Constructor & Destructor Documentation

◆ ParallelForAsyncJob()

template<typename Fn >
Foundation::Core::ParallelForAsyncJob< Fn >::ParallelForAsyncJob ( ParallelForAsyncState< Fn > *  s)
inlineexplicit

Member Function Documentation

◆ Execute()

template<typename Fn >
void Foundation::Core::ParallelForAsyncJob< Fn >::Execute ( size_t  workerId)
inlineoverridevirtualnoexcept

Implements Foundation::Core::Job.

Member Data Documentation

◆ state

template<typename Fn >
ParallelForAsyncState<Fn>* Foundation::Core::ParallelForAsyncJob< Fn >::state {nullptr}

The documentation for this struct was generated from the following file: