47 friend class Executor;
191 Node* _node {
nullptr};
203inline void AsyncTask::_incref() {
205 std::get_if<Node::DependentAsync>(&(_node->_handle))->use_count.fetch_add(
206 1, std::memory_order_relaxed
212inline void AsyncTask::_decref() {
213 if(_node && std::get_if<Node::DependentAsync>(&(_node->_handle))->use_count.fetch_sub(
214 1, std::memory_order_acq_rel
255 return _node ? _node->_exception_ptr :
nullptr;
260 return _node ? (_node->_exception_ptr !=
nullptr) :
false;
265 return _node ==
nullptr;
276 return std::hash<Node*>{}(_node);
281 return _node ==
nullptr ?
size_t{0} :
282 std::get_if<Node::DependentAsync>(&(_node->_handle))->use_count.load(
283 std::memory_order_relaxed
289 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:233
AsyncTask & operator=(const AsyncTask &rhs)
copy-assigns the dependent-async task from rhs
Definition async_task.hpp:238
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:280
void reset()
release the managed object of this
Definition async_task.hpp:269
bool has_exception_ptr() const
queries if the task has an exception pointer
Definition async_task.hpp:259
size_t hash_value() const
obtains the hashed value of this dependent-async task
Definition async_task.hpp:275
std::exception_ptr exception_ptr() const
retrieves the exception pointer of this task
Definition async_task.hpp:254
bool empty() const
checks if this dependent-async task is associated with any task
Definition async_task.hpp:264
bool is_done() const
checks if this dependent-async task finishes
Definition async_task.hpp:288
taskflow namespace
Definition small_vector.hpp:20