Go to the source code of this file.
Data Structures | |
struct | tsem_t |
Functions | |
void | tsem_init (tsem_t *tsem, unsigned int val) |
void | tsem_deinit (tsem_t *tsem) |
void | tsem_down (tsem_t *tsem) |
void | tsem_up (tsem_t *tsem) |
void | tsem_reset (tsem_t *tsem) |
void | tsem_wait (tsem_t *tsem) |
void | tsem_signal (tsem_t *tsem) |
Copyright (C) 2007 STMicroelectronics Copyright (C) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
$Date$ Revision $Rev$ Author $Author$
Implements a simple inter-thread semaphore so as not to have to deal with IPC creation and the like.
Copyright (C) 2007 STMicroelectronics Copyright (C) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
$Date$ Revision $Rev$ Author $Author$
Definition in file src/tsemaphore.h.
void tsem_deinit | ( | tsem_t * | tsem | ) |
Destroy the semaphore
tsem | the semaphore to destroy |
Definition at line 52 of file src/tsemaphore.c.
void tsem_down | ( | tsem_t * | tsem | ) |
Decreases the value of the semaphore. Blocks if the semaphore value is zero.
tsem | the semaphore to decrease |
Definition at line 62 of file src/tsemaphore.c.
void tsem_init | ( | tsem_t * | tsem, | |
unsigned int | val | |||
) |
Initializes the semaphore at a given value
tsem | the semaphore to initialize | |
val | the initial value of the semaphore |
tsem | the semaphore to initialize | |
val | the initial value of the semaphore |
Definition at line 42 of file src/tsemaphore.c.
void tsem_reset | ( | tsem_t * | tsem | ) |
Reset the value of the semaphore
tsem | the semaphore to reset |
Definition at line 86 of file src/tsemaphore.c.
void tsem_signal | ( | tsem_t * | tsem | ) |
Signal the condition,if waiting
tsem | the semaphore to signal |
Definition at line 106 of file src/tsemaphore.c.
void tsem_up | ( | tsem_t * | tsem | ) |
Increases the value of the semaphore
tsem | the semaphore to increase |
Definition at line 75 of file src/tsemaphore.c.
void tsem_wait | ( | tsem_t * | tsem | ) |
Wait on the condition.
tsem | the semaphore to wait |
Definition at line 96 of file src/tsemaphore.c.