thrd_yield()
QNX SDP8.0C Library ReferenceAPIDeveloper
Yield to other ready threads at the same priority
Synopsis:
#include <threads.h>
void thrd_yield( void );
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The thrd_yield() function checks to see if other threads at the same priority as that of the calling thread are READY to run. If so, the calling thread yields to them and places itself at the end of the READY thread queue for that priority. The thrd_yield() function never yields to a lower-priority thread.
Note:
You should avoid designing programs that contain busy wait loops.
If you can't avoid them, you can use
thrd_yield() to reduce the scheduling latency for other threads at a given priority level.
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | Yes |
Thread | Yes |
Page updated: