reader_th = new rtos::Thread(osPriorityNormal - 2);
This appears to always give priority normal, which is good as any other priority seems to cause a hang. It would also be nice to have the thread named. If changed to:
reader_th = new rtos::Thread(osPriorityNormal - 2, OS_STACK_SIZE, nullptr, "readSocket");
then a compile error is returned for the priority.
I would suggest this should be changed to:
reader_th = new rtos::Thread(osPriorityNormal, OS_STACK_SIZE, nullptr, "readSocket");
reader_th = new rtos::Thread(osPriorityNormal - 2);
This appears to always give priority normal, which is good as any other priority seems to cause a hang. It would also be nice to have the thread named. If changed to:reader_th = new rtos::Thread(osPriorityNormal - 2, OS_STACK_SIZE, nullptr, "readSocket");
then a compile error is returned for the priority. I would suggest this should be changed to:reader_th = new rtos::Thread(osPriorityNormal, OS_STACK_SIZE, nullptr, "readSocket");