4#ifndef included_AMP_ThreadPoolWorkItem
5#define included_AMP_ThreadPoolWorkItem
8#include "AMP/utils/threadpool/ThreadPoolId.h"
21 virtual void run() = 0;
This a class to hold the work item id.
Base class for the work item (users should derive from ThreadPool::WorkItemRet)
void add_dependency(const ThreadPoolID &id)
Add a work item to the list of dependencies.
virtual void run()=0
Function to run the routine.
void add_dependencies(std::size_t N, const ThreadPoolID *ids)
Add a list of work item to the list of dependencies Note: this function is thread-safe for the thread...
void add_dependencies(const std::vector< ThreadPoolID > &ids)
Add a list of work item to the list of dependencies.
std::size_t get_N_dependencies() const
Get the number of work ids that this work item depends on.
auto getStatus() const
Get the current status.
virtual ~ThreadPoolWorkItem()
Empty deconstructor.
volatile ThreadPoolID::Status d_state
ThreadPoolWorkItem(const ThreadPoolWorkItem &)=delete
ThreadPoolWorkItem & operator=(const ThreadPoolWorkItem &)=delete
std::vector< ThreadPoolID > get_dependencies() const
Return the list of work ids that we depend on.
volatile std::atomic_int32_t d_count
virtual bool has_result() const =0
Will the routine return a result.
This is a concrete class that provides for a basic thread pool.