Main thread loop question
Moderators: RoccoMarco, lbednarz, tfAteba
Main thread loop question
In trying to get mailboxes working I wrote a basic application with two threads, one that posted a message every 100ms and one in a while(TRUE) loop that just fetched and toggled the status LED when there was a message. What I found was that it only worked if I had a loop (while(TRUE) chThdSleepMilliseconds(500);) in the main thread. Otherwise it breaks. I was wondering why this is, as it is not intuitive to me.
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times