In this example the first thread (the main () function) sends signals to the second thread at regular intervals. The second thread waits until an event signal does not arrive. Each time the signal arrives, the program toggles the status of LED1. Note, that the return value of the Thread :: signal_wait () function is examined and is printed out as well. Just for fun thread2: accepts any signal, and thead1 provides all possible signals from 1 to 32768.

Dependencies:   mbed mbed-rtos

Changes

RevisionDateWhoCommit message
0:bd08296227ad 2022-03-17 cspista Final version default tip