# sem.c File Reference

## Detailed Description

Semaphore functions.

Author:
  Paolo Mantegazza

Note:
  Copyright (C) 1999-2003 Paolo Mantegazza <mantegazza@aero.polimi.it>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Include dependency graph for sem.c:

## Functions

void | rt_typed_sem_init (SEM *sem, int value, int type)
| Initialize a specifically typed (counting, binary, resource) semaphore.
void | rt_sem_init (SEM *sem, int value)
| Initialize a counting semaphore.
int | rt_sem_delete (SEM *sem)
| Delete a semaphore.
int | rt_sem_signal (SEM *sem)
| Signaling a semaphore.
int | rt_sem_broadcast (SEM *sem)
| Signaling a semaphore.
int | rt_sem_wait (SEM *sem)
| Take a semaphore.
int | rt_sem_wait_if (SEM *sem)
| Take a semaphore, only if the calling task is not blocked.
int | rt_sem_wait_until (SEM *sem, RTIME time)
| Wait a semaphore with timeout.
int | rt_sem_wait_timed (SEM *sem, RTIME delay)
| Wait a semaphore with timeout.
int | rt_sem_wait_barrier (SEM *sem)
| Wait on a semaphore barrier.
int | rt_cond_signal (CND *cnd)
| Wait for a signal to a conditional variable.
int | rt_cond_wait (CND *cnd, SEM *mtx)
| Wait for a signal to a conditional variable.
int | rt_cond_wait_until (CND *cnd, SEM *mtx, RTIME time)
| Wait a semaphore with timeout.
int | rt_cond_wait_timed (CND *cnd, SEM *mtx, RTIME delay)
| Wait a semaphore with timeout.
int | rt_rwl_init (RWL *rwl)
| Initialize a multi readers single writer lock.
int | rt_rwl_delete (RWL *rwl)
| destroys a multi readers single writer lock.
int | rt_rwl_rdlock (RWL *rwl)
| acquires a multi readers single writer lock for reading.
int | rt_rwl_rdlock_if (RWL *rwl)
| try to acquire a multi readers single writer lock just for reading.
int | rt_rwl_rdlock_until (RWL *rwl, RTIME time)
| try to acquire a multi readers single writer lock for reading within an absolute deadline time.
int | rt_rwl_rdlock_timed (RWL *rwl, RTIME delay)
| try to acquire a multi readers single writer lock for reading within a relative deadline time.
int | rt_rwl_wrlock (RWL *rwl)
| acquires a multi readers single writer lock for wrtiting.
int | rt_rwl_wrlock_if (RWL *rwl)
| acquires a multi readers single writer lock for writing.
int | rt_rwl_wrlock_until (RWL *rwl, RTIME time)
| try to acquire a multi readers single writer lock for writing within an absolute deadline time.
int | rt_rwl_wrlock_timed (RWL *rwl, RTIME delay)
| try to acquire a multi readers single writer lock for writing within a relative deadline time.
int | rt_rwl_unlock (RWL *rwl)
| unlock an acquired multi readers single writer lock.
int | rt_spl_init (SPL *spl)
| Initialize a spinlock.
int | rt_spl_delete (SPL *spl)
| Initialize a spinlock.
int | rt_spl_lock (SPL *spl)
| Acquire a spinlock.
int | rt_spl_lock_if (SPL *spl)
| Acquire a spinlock without waiting.
int | rt_spl_lock_timed (SPL *spl, unsigned long ns)
| Acquire a spinlock with timeout.
int | rt_spl_unlock (SPL *spl)
| Release an owned spinlock.
SEM * | _rt_typed_named_sem_init (unsigned long sem_name, int value, int type)
| Initialize a specifically typed (counting, binary, resource) semaphore identified by a name.
int | rt_named_sem_delete (SEM *sem)
| Delete a semaphore initialized in named mode.
RWL * | _rt_named_rwl_init (unsigned long rwl_name)
| Initialize a multi readers single writer lock identified by a name.
int | rt_named_rwl_delete (RWL *rwl)
| Delete a multi readers single writer lock in named mode.
SPL * | _rt_named_spl_init (unsigned long spl_name)
| Initialize a spinlock identified by a name.
int | rt_named_spl_delete (SPL *spl)
| Delete a spinlock in named mode.