This function is a non-portable Realtime Linux extension. pthread_wakeup_np wakes up the realtime thread thread.
This function is safe to call from interrupt handlers and threads, but not from the Linux kernel. Calling the function will cause a thread switch if the awakened thread is higher priority than the current thread and they are both on the same processor. In this case, pthread_wakeup called from an interrupt handler will suspend the current thread at once. The handler will complete when there are no more runnable higher priority threads.
To illustrate, suppose we want to have very simple interrupt handlers (always a good idea), but we need complex processing done after each interrupt. We can designate a thread to do this processing and give it the highest priority. Then the interrupt handlers may push some data into a queue and call pthread_wakeup, to wake up the thread and switch to it at once. (WARNING: Do not leave any critical hardware handshaking until after the return from pthread_wakeup_np, unless it is okay for the handshaking to be postponed until the interrupted thread is scheduled again.)
Michael Barabanov and Victor Yodaiken (email@example.com)