rt_sem_trywait2
Semaphore 'wait' operation (without blocking)
Usage
#define MODULE #include <linux/module.h> #include <linux/kernel.h> #include <linux/version.h> #include <linux/errno.h> #include rt_ipc.h
int rt_sem_trywait(rt_sem_t *sem);
Overview
rt_sem_wait is the semaphore wait (sometimes known as 'take' or 'P') operation. Unlike rt_sem_wait, rt_sem_trywait returns immediately whether or not the semaphore is available. sem points to the structure used in the call to rt_sem_create.
Return value
On success, 0 is returned. On failure, a negative value is returned as described below.
Errors
|
the semaphore is not currently available. |
|---|---|
|
sem does not point to a valid rt_sem_t. |