Loader refactored (#235)
- Moved all Loader functionality into Loader class - Improvement for Dispatcher construction - Dispatcher and DispatcherThread: you can now specify the timeout when calling `dispatch()`. Default timeout is max timeout.
This commit is contained in:
committed by
GitHub
parent
bd2786b122
commit
de46401d85
@@ -38,7 +38,7 @@ private:
|
||||
};
|
||||
|
||||
Mutex mutex;
|
||||
std::queue<std::shared_ptr<DispatcherMessage>> queue;
|
||||
std::queue<std::shared_ptr<DispatcherMessage>> queue = {};
|
||||
EventFlag eventFlag;
|
||||
|
||||
public:
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
* @param[in] function the function to execute elsewhere
|
||||
* @param[in] context the data to pass onto the function
|
||||
*/
|
||||
void dispatch(Function function, std::shared_ptr<void> context);
|
||||
void dispatch(Function function, std::shared_ptr<void> context, TickType_t timeout = portMAX_DELAY);
|
||||
|
||||
/**
|
||||
* Consume 1 or more dispatched function (if any) until the queue is empty.
|
||||
|
||||
Reference in New Issue
Block a user