![]() |
Open FFBoard
Open source force feedback firmware
|
#include <workqueue.hpp>
Classes | |
class | CWorkerThread |
Public Member Functions | |
WorkQueue (const char *const Name, uint16_t StackDepth=DEFAULT_WORK_QUEUE_STACK_SIZE, UBaseType_t Priority=DEFAULT_WORK_QUEUE_PRIORITY, UBaseType_t MaxWorkItems=DEFAULT_MAX_WORK_ITEMS) | |
WorkQueue (uint16_t StackDepth=DEFAULT_WORK_QUEUE_STACK_SIZE, UBaseType_t Priority=DEFAULT_WORK_QUEUE_PRIORITY, UBaseType_t MaxWorkItems=DEFAULT_MAX_WORK_ITEMS) | |
~WorkQueue () | |
~WorkQueue ()=delete | |
bool | QueueWork (WorkItem *work) |
Private Attributes | |
CWorkerThread * | WorkerThread |
Queue * | WorkItemQueue |
BinarySemaphore * | ThreadComplete |
This class is the "engine" for WorkItems. Create one or more WorkQueues to accept WorkItems. WorkQueues pull WorkItems off of a FIFO queue and run them sequentially.
Definition at line 126 of file workqueue.hpp.
WorkQueue::WorkQueue | ( | const char *const | Name, |
uint16_t | StackDepth = DEFAULT_WORK_QUEUE_STACK_SIZE , |
||
UBaseType_t | Priority = DEFAULT_WORK_QUEUE_PRIORITY , |
||
UBaseType_t | MaxWorkItems = DEFAULT_MAX_WORK_ITEMS |
||
) |
Constructor to create a named WorkQueue.
ThreadCreateException,QueueCreateException,SemaphoreCreateException |
Name | Name of the thread internal to the WorkQueue. Only useful for debugging. |
StackDepth | Number of "words" allocated for the Thread stack. |
Priority | FreeRTOS priority of this Thread. |
MaxWorkItems | Maximum number of WorkItems this WorkQueue can hold. |
Definition at line 63 of file cworkqueue.cpp.
WorkQueue::WorkQueue | ( | uint16_t | StackDepth = DEFAULT_WORK_QUEUE_STACK_SIZE , |
UBaseType_t | Priority = DEFAULT_WORK_QUEUE_PRIORITY , |
||
UBaseType_t | MaxWorkItems = DEFAULT_MAX_WORK_ITEMS |
||
) |
Constructor to create an unnamed WorkQueue.
ThreadCreateException,QueueCreateException,SemaphoreCreateException |
StackDepth | Number of "words" allocated for the Thread stack. |
Priority | FreeRTOS priority of this Thread. |
MaxWorkItems | Maximum number of WorkItems this WorkQueue can hold. |
Definition at line 82 of file cworkqueue.cpp.
WorkQueue::~WorkQueue | ( | ) |
Our destructor.
Definition at line 102 of file cworkqueue.cpp.
|
delete |
If we can't delete a task, it makes no sense to have a destructor.
bool WorkQueue::QueueWork | ( | WorkItem * | work | ) |
Send a WorkItem off to be executed.
work | Pointer to a WorkItem. |
Definition at line 137 of file cworkqueue.cpp.
|
private |
Semaphore to support deconstruction without race conditions.
Definition at line 240 of file workqueue.hpp.
|
private |
Pointer to our WorkerThread.
Definition at line 230 of file workqueue.hpp.
|
private |
Pointer to our work queue itself.
Definition at line 235 of file workqueue.hpp.