4#ifndef included_AMP_ThreadPoolID
5#define included_AMP_ThreadPoolID
14class ThreadPoolWorkItem;
45#if !defined( WIN32 ) && !defined( _WIN32 ) && !defined( WIN64 ) && !defined( _WIN64 )
99 inline bool started()
const {
return static_cast<int>(
status() ) >= 2; }
125 void reset( int8_t priority, uint64_t local_id,
void *work );
127 static uint64_t
createId( int8_t priority, uint64_t local_id );
140 volatile std::atomic_int32_t *
d_count =
nullptr;
This a class to hold the work item id.
ThreadPoolID & operator=(volatile ThreadPoolID &&rhs) volatile
ThreadPoolID(const ThreadPoolID &rhs)
bool operator>(const volatile ThreadPoolID &rhs) const volatile
ThreadPoolWorkItem * getWork() const
Check if thread id is null.
~ThreadPoolID()
Destructor.
bool operator>=(const volatile ThreadPoolID &rhs) const volatile
static constexpr uint64_t nullThreadID
void reset() volatile
Reset the id back to a NULL id.
bool operator>(const ThreadPoolID &rhs) const
static uint64_t createId(int8_t priority, uint64_t local_id)
ThreadPoolID()=default
Empty constructor.
bool finished() const
Check if the work has finished.
uint64_t getLocalID() const
static constexpr uint64_t maxThreadID
bool operator<=(const volatile ThreadPoolID &rhs) const volatile
bool initialized() const volatile
ThreadPoolID & operator=(ThreadPoolID &&rhs)
bool operator<(const ThreadPoolID &rhs) const
void reset(int8_t priority, uint64_t local_id, void *work)
ThreadPoolID & operator=(const volatile ThreadPoolID &rhs) volatile
volatile std::atomic_int32_t * d_count
ThreadPoolID & operator=(const ThreadPoolID &rhs)
Status status() const
Return the status of the work item.
bool operator!=(const volatile ThreadPoolID &rhs) const volatile
bool isNull() const
Check if thread id is null.
ThreadPoolID & operator=(const ThreadPoolID &rhs) volatile
bool operator!=(const ThreadPoolID &rhs) const
int8_t getPriority() const
bool operator<=(const ThreadPoolID &rhs) const
ThreadPoolID & operator=(const volatile ThreadPoolID &rhs)
ThreadPoolID(const volatile ThreadPoolID &rhs)
Copy constructors.
bool started() const
Check if the work has started (will return true if it has started or finished)
void swap(ThreadPoolID &rhs)
swap with rhs
ThreadPoolID(volatile ThreadPoolID &&rhs)
bool operator>=(const ThreadPoolID &rhs) const
void setPriority(int8_t priority)
bool operator==(const ThreadPoolID &rhs) const
bool operator<(const volatile ThreadPoolID &rhs) const volatile
bool operator==(const volatile ThreadPoolID &rhs) const volatile
Base class for the work item (users should derive from ThreadPool::WorkItemRet)