Made Processor keep an init token to prevent early threadpool join

This commit is contained in:
Paul-Louis Ageneau
2020-07-08 02:46:19 +02:00
parent dd2967b0e1
commit db00253c18
4 changed files with 7 additions and 6 deletions

View File

@ -20,6 +20,7 @@
#define RTC_PROCESSOR_H
#include "include.hpp"
#include "init.hpp"
#include "threadpool.hpp"
#include <condition_variable>
@ -49,6 +50,9 @@ public:
protected:
void schedule();
// Keep an init token
const init_token mInitToken = Init::Token();
std::queue<std::function<void()>> mTasks;
bool mPending = false; // true iff a task is pending in the thread pool