Files | |
file | synch.c |
Thread synchronization services. | |
Functions | |
void | xnsynch_init (xnsynch_t *synch, xnflags_t flags) |
Initialize a synchronization object. | |
void | xnsynch_sleep_on (xnsynch_t *synch, xnticks_t timeout) |
Sleep on a synchronization object. | |
static void | xnsynch_clear_boost (xnsynch_t *synch, xnthread_t *lastowner) |
Clear the priority boost. | |
void | xnsynch_renice_sleeper (xnthread_t *thread) |
Change a sleeper's priority. | |
xnthread_t * | xnsynch_wakeup_one_sleeper (xnsynch_t *synch) |
Give the resource ownership to the next waiting thread. | |
xnpholder_t * | xnsynch_wakeup_this_sleeper (xnsynch_t *synch, xnpholder_t *holder) |
Give the resource ownership to a given waiting thread. | |
int | xnsynch_flush (xnsynch_t *synch, xnflags_t reason) |
Unblock all waiters pending on a resource. | |
void | xnsynch_forget_sleeper (xnthread_t *thread) |
Abort a wait for a resource. | |
void | xnsynch_release_all_ownerships (xnthread_t *thread) |
Release all ownerships. |
|
Clear the priority boost.
For internal use only. This service is called internally whenever a synchronization object is not claimed anymore by sleepers to reset the object owner's priority to its initial level.
|
|
Unblock all waiters pending on a resource. This service atomically releases all threads which currently sleep on a given resource. This service should be called by upper interfaces under circumstances requiring that the pending queue of a given resource is cleared, such as before the resource is deleted.
Environments: This service can be called from:
Rescheduling: never. |
|
Abort a wait for a resource.
For internal use only. Performs all the necessary housekeeping chores to stop a thread from waiting on a given synchronization object.
|
|
Initialize a synchronization object. Initializes a new specialized object which can subsequently be used to synchronize real-time activities. The Xenomai nucleus provides a basic synchronization object which can be used to build higher resource objects. Nucleus threads can wait for and signal such objects in order to synchronize their activities. This object has built-in support for priority inheritance.
Environments: This service can be called from:
Rescheduling: never. |
|
Release all ownerships.
For internal use only. This call is used internally to release all the ownerships obtained by a thread on synchronization objects. This routine must be entered interrupts off.
|
|
Change a sleeper's priority.
For internal use only. This service is used by the PIP code to update the pending priority of a sleeping thread.
|
|
Sleep on a synchronization object. Makes the calling thread sleep on the specified synchronization object, waiting for it to be signaled. This service should be called by upper interfaces wanting the current thread to pend on the given resource.
This service can be called from:
Rescheduling: always.
|
|
Give the resource ownership to the next waiting thread. This service gives the ownership of a synchronization object to the thread which is currently leading the object's pending list. The sleeping thread is unblocked, but no action is taken regarding the previous owner of the resource. This service should be called by upper interfaces wanting to signal the given resource so that a single waiter is resumed.
Environments: This service can be called from:
Rescheduling: never. |
|
Give the resource ownership to a given waiting thread. This service gives the ownership of a given synchronization object to a specific thread which is currently pending on it. The sleeping thread is unblocked from its pending state. No action is taken regarding the previous resource owner. This service should be called by upper interfaces wanting to signal the given resource so that a specific waiter is resumed.
Environments: This service can be called from:
Rescheduling: never. |