Files | |
file | registry.c |
This file is part of the RTAI project. | |
Functions | |
int | rt_registry_enter (const char *key, void *objaddr, rt_handle_t *phandle) |
Register a real-time object. | |
int | rt_registry_bind (const char *key, RTIME timeout, rt_handle_t *phandle) |
Bind to a real-time object. | |
int | rt_registry_remove (rt_handle_t handle) |
Unregister a real-time object. | |
void * | rt_registry_get (rt_handle_t handle) |
Find and lock a real-time object into the registry. | |
u_long | rt_registry_put (rt_handle_t handle) |
Unlock a real-time object from the registry. | |
void * | rt_registry_fetch (rt_handle_t handle) |
Find a real-time object into the registry. |
|
Bind to a real-time object. This service retrieves the registry handle of a given object identified by its key. Unless otherwise specified, this service will block the caller if the object is not indexed yet, waiting for such indexing to occur.
Side-effect: This routine calls the rescheduling procedure if the searched object is not registered on entry and timeout is different from RT_TIME_NONBLOCK. Context: This routine can be called on behalf of a task.
|
|
Register a real-time object. This service allocates a new registry slot for an associated object, and indexes it by an alphanumeric key for later retrieval.
Side-effect: This routine calls the rescheduling procedure if some task is currently waiting for a registration to occur. Context: This routine can be called on behalf of a task or from the initialization code. |
|
Find a real-time object into the registry. This service retrieves an object from its handle into the registry and returns the memory address of its descriptor.
|
|
Find and lock a real-time object into the registry. This service retrieves an object from its handle into the registry and prevents it deletion atomically. A locking count is tracked, so that rt_registry_get() and rt_registry_put() must be used in pair.
|
|
Unlock a real-time object from the registry. This service decrements the lock count of a registered object previously locked by a call to rt_registry_get(). The object is actually unlocked from the registry when the locking count falls down to zero, thus waking up any task currently waiting inside rt_registry_remove() for unregistering it.
Context: This routine can be called on behalf of a task. It can also be called on behalf of an interrupt context, or from the initialization code, provided handle is different from RT_REGISTRY_SELF. |
|
Unregister a real-time object. This service removes an object from the registry. The caller might sleep as a result of waiting for the target object to be unlocked prior to the removal (see rt_registry_put()), unless it is called on behalf of the root thread (e.g. the initialization code); in the latter case, the removal is simply forced.
Side-effect: This routine calls the rescheduling procedure if the object to remove is currently locked. Context: This routine can be called on behalf of a task or the initialization code. |