47 friend class Executor;
191 Node* _node {
nullptr};
203inline void AsyncTask::_incref() {
207 _node->_estate.fetch_add(ESTATE::REFCOUNT_ONE, std::memory_order_relaxed);
212inline void AsyncTask::_decref() {
217 if((_node->_estate.fetch_sub(ESTATE::REFCOUNT_ONE, std::memory_order_acq_rel)
218 & ESTATE::REFCOUNT_MASK) == ESTATE::REFCOUNT_ONE) {
259 return _node ? _node->_exception_ptr :
nullptr;
264 return _node ? (_node->_exception_ptr !=
nullptr) :
false;
269 return _node ==
nullptr;
280 return std::hash<Node*>{}(_node);
285 return _node ==
nullptr ?
size_t{0} :
287 _node->_estate.load(std::memory_order_relaxed) & ESTATE::REFCOUNT_MASK
293 return _node ==
nullptr ?
true: (_node->_estate.load(std::memory_order_acquire) & ESTATE::FINISHED);
~AsyncTask()
destroys the managed dependent-async task if this is the last owner
Definition async_task.hpp:237
AsyncTask & operator=(const AsyncTask &rhs)
copy-assigns the dependent-async task from rhs
Definition async_task.hpp:242
AsyncTask()=default
constructs an empty task handle
size_t use_count() const
returns the number of shared owners that are currently managing this dependent-async task
Definition async_task.hpp:284
void reset()
release the managed object of this
Definition async_task.hpp:273
bool has_exception_ptr() const
queries if the task has an exception pointer
Definition async_task.hpp:263
size_t hash_value() const
obtains the hashed value of this dependent-async task
Definition async_task.hpp:279
std::exception_ptr exception_ptr() const
retrieves the exception pointer of this task
Definition async_task.hpp:258
bool empty() const
checks if this dependent-async task is associated with any task
Definition async_task.hpp:268
bool is_done() const
checks if this dependent-async task finishes
Definition async_task.hpp:292
taskflow namespace
Definition small_vector.hpp:20