21#include "platform/Callback.h"
22#include "platform/mbed_assert.h"
46 typedef void (*run_callback_t)(
void *data);
119 virtual run_callback_t
start(
void *data, uint32_t
size) = 0;
136 uint16_t _start_count;
147 run_callback_t _start(
void *buffer, uint32_t
size);
void cancel()
Cancel the execution of this task.
virtual uint32_t size()=0
Size of buffer required for TaskBase::start.
TaskBase(TaskQueue *q)
Construct a new TaskBase object.
void wait()
Wait for this task to finish execution.
void set(TaskQueue *q)
Set the queue of this task.
void post()
Post this task to the set TaskQueue for execution.
bool finished()
Check if the callback has run to completion or been fully canceled.
virtual ~TaskBase()
Destroy this TaskBase.
virtual run_callback_t start(void *data, uint32_t size)=0
Copy any callback data and return a callback to run.
virtual void finish()
Inform this task that execution has finished.
bool ready()
Return true if this task is ready to be posted.
The Semaphore class is used to manage and protect access to a set of shared resources.