2020-07-05 21:11:40 +00:00
|
|
|
#include "WorkerThread.h"
|
2020-07-06 08:45:55 +00:00
|
|
|
#include "timing.h"
|
2020-07-05 21:11:40 +00:00
|
|
|
|
|
|
|
namespace concurrency {
|
|
|
|
|
|
|
|
void WorkerThread::doRun()
|
|
|
|
{
|
|
|
|
while (!wantExit) {
|
|
|
|
block();
|
|
|
|
|
|
|
|
#ifdef DEBUG_STACK
|
|
|
|
static uint32_t lastPrint = 0;
|
2020-07-06 08:45:55 +00:00
|
|
|
if (timing::millis() - lastPrint > 10 * 1000L) {
|
|
|
|
lastPrint = timing::millis();
|
2020-07-05 21:11:40 +00:00
|
|
|
uint32_t taskHandle = reinterpret_cast<uint32_t>(xTaskGetCurrentTaskHandle());
|
|
|
|
DEBUG_MSG("printThreadInfo(%s) task: %" PRIx32 " core id: %u min free stack: %u\n", "thread", taskHandle, xPortGetCoreID(),
|
|
|
|
uxTaskGetStackHighWaterMark(nullptr));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
loop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace concurrency
|