C/C++ API Reference
Loading...
Searching...
No Matches
pw::async2::internal::AllocatedTask< Pendable > Class Template Referencefinal
Inheritance diagram for pw::async2::internal::AllocatedTask< Pendable >:
pw::async2::OwnedTask pw::async2::Task pw::containers::future::IntrusiveList< T >::Item

Public Member Functions

template<typename... Args>
 AllocatedTask (pw::allocator::Deallocator &deallocator, Args &&... args)
 
- Public Member Functions inherited from pw::async2::Task
constexpr Task (log::Token name=kDefaultName)
 
 Task (const Task &)=delete
 
 Task (Task &&)=delete
 
Taskoperator= (const Task &)=delete
 
Taskoperator= (Task &&)=delete
 
virtual ~Task ()=default
 
Poll Pend (Context &cx)
 
bool IsRegistered () const
 
void Deregister ()
 

Private Member Functions

Poll DoPend (Context &cx) override
 
void DoDestroy () override
 

Additional Inherited Members

- Protected Member Functions inherited from pw::async2::OwnedTask
constexpr OwnedTask (log::Token name=kDefaultName)
 
- Protected Member Functions inherited from pw::containers::future::IntrusiveList< T >::Item
constexpr Item ()=default
 

Member Function Documentation

◆ DoDestroy()

template<typename Pendable >
void pw::async2::internal::AllocatedTask< Pendable >::DoDestroy ( )
inlineoverrideprivatevirtual

The DoDestroy implementation must destroy this task and free its memory.

DoDestroy is normally invoked by a Dispatcher after a Posted OwnedTask completes.

This function is currently private, but potentially could be used by a Tasks delegating to other OwnedTasks.

Implements pw::async2::OwnedTask.

◆ DoPend()

template<typename Pendable >
Poll pw::async2::internal::AllocatedTask< Pendable >::DoPend ( Context )
inlineoverrideprivatevirtual

Attempts to advance this Task to completion.

This method should not perform synchronous waiting, as doing so may block the main Dispatcher loop and prevent other Task s from progressing. Because of this, Task s should not invoke blocking Dispatcher methods such as RunUntilComplete.

Tasks should also avoid invoking RunUntilStalled on their own Dispatcher.

Returns Ready if complete, or Pending if the Task was not yet able to complete.

If Pending is returned, the Task must ensure it is woken up when it is able to make progress. To do this, Task::Pend must arrange for Waker::Wake to be called, either by storing a copy of the Waker away to be awoken by another system (such as an interrupt handler).

Implements pw::async2::Task.


The documentation for this class was generated from the following file: