Posts a thread of an event completion.
Standard C library (libc.a)
#include <sys/thread.h>
int thread_post( tid)
tid_t tid;
The thread_post subroutine posts the thread whose thread ID is indicated by the value of the tid parameter, of the occurrence of an event. If the posted thread is waiting in thread_wait, it will be awakened immediately. If it not waiting in thread_wait, the next call to thread_wait does not block but returns with success immediately.
Multiple posts to the same thread without an intervening wait by the specified thread will only count as a single post. The posting remains in effect until the indicated thread calls the thread_wait subroutine upon which the posting gets cleared.
The thread_wait and the thread_post subroutine can be used by applications to implement a fast IPC mechanism between threads in different processes.
tid | Specifies the thread ID of the thread to be posted. |
On successful completion, the thread_post subroutine returns a value of 0. If unsuccessful, a value of -1 is returned and the global variable errno is set to indicate the error.
The thread_wait (thread_wait Subroutine) subroutine, and thread_post_many (thread_post_many Subroutine) subroutine.