This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Setting Signals to Inactive Threads

I have couple questions regarding setting signals to inactive threads using RTX and CMSIS. Please see the example code below:

osThreadId thread_id = osThreadCreate(osThread(thread_body), NULL); /* set thread active */

osThreadTerminate(thread_id); /* set thread inactive */

osSignalSet(thread_id, 1); /* set signal to inactive thread */

osThreadCreate(osThread(thread_body), NULL); /* set same thread active again */

void thread_body (void const * arg)
{ osSignalWait(1, 0); /* is the signal set? */
}

Questions:
1) The signal is set while the thread is inactive. What is the effect of this?
2) In the thread_body function, will the signal be set?

Thank you