Skip to content

Commit

Permalink
Add missing canceled() function to local_task
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Feb 6, 2015
1 parent 348544a commit 15488e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/async++/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,12 @@ class LIBASYNC_CACHELINE_ALIGN local_task {
return internal_task.ready();
}

// Query whether the task has been canceled with an exception
bool canceled() const
{
return internal_task.state.load(std::memory_order_acquire) == detail::task_state::canceled;
}

// Wait for the task to complete
void wait()
{
Expand Down

0 comments on commit 15488e5

Please sign in to comment.