|
RTE OSAdapter POSIX 0.1.0 build 41b3eb3
POSIX/Linux OAL OSAdapter for Platform_RTE
|
Private helper: a bounded wait for a pthread mutex (OSA rule R2: every wait bounded). More...
#include <pthread.h>#include "rte/utils/status/rte_status.h"#include "rte/utils/types/rte_types.h"Go to the source code of this file.
Functions | |
| rte_status_t | posix_osa_lock_bounded (pthread_mutex_t *mutex, rte_duration_ms_t timeout_ms) |
| Waits at most timeout_ms for a pthread mutex. | |
Private helper: a bounded wait for a pthread mutex (OSA rule R2: every wait bounded).
One implementation of the timed-lock semantics (REQ-OAL-MUTEX-014) shared by the mutex OSAdapter's lock_timed and the memory OSAdapter's pool lock (REQ-OAL-MEM-015). Not installed: an internal header of this product, like rte_posix_osadapter_poll.h. A source file including it defines _POSIX_C_SOURCE before its first include (glibc declares the pthread timed-lock and clock calls only under a POSIX feature-test macro).
Definition in file rte_posix_osadapter_lock.h.
| rte_status_t posix_osa_lock_bounded | ( | pthread_mutex_t * | mutex, |
| rte_duration_ms_t | timeout_ms ) |
Waits at most timeout_ms for a pthread mutex.
timeout_ms == 0 is one pthread_mutex_trylock(). Otherwise:
A failed clock read returns RTE_STATUS_INTERNAL_ERROR, never an unbounded wait.
| mutex | Initialised pthread mutex to lock. Must not be NULL. |
| timeout_ms | Maximum time to wait, in milliseconds; 0 is one non-blocking try. |
Local variables declarations Global variables declarations Global functions
Definition at line 44 of file rte_posix_osadapter_lock.c.