OpenMAX Bellagio 0.9.3
|
#include <pthread.h>
#include <sys/time.h>
#include <errno.h>
#include "tsemaphore.h"
#include "omx_comp_debug_levels.h"
Go to the source code of this file.
Functions | |
int | tsem_init (tsem_t *tsem, unsigned int val) |
void | tsem_deinit (tsem_t *tsem) |
int | tsem_timed_down (tsem_t *tsem, unsigned int milliSecondsDelay) |
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) |
void tsem_deinit | ( | tsem_t * | tsem | ) |
Destroy the semaphore
tsem | the semaphore to destroy |
Definition at line 57 of file tsemaphore.c.
References tsem_t::condition, tsem_t::mutex, and OSCL_EXPORT_REF.
Referenced by base_constructor_remove_garbage_collected(), base_port_Destructor(), omx_base_component_Destructor(), and omx_clocksrc_component_Destructor().
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 97 of file tsemaphore.c.
References tsem_t::condition, tsem_t::mutex, OSCL_EXPORT_REF, and tsem_t::semval.
Referenced by base_port_DisablePort(), base_port_EnablePort(), base_port_FlushProcessingBuffers(), clocksrc_port_FlushProcessingBuffers(), compMessageHandlerFunction(), main(), omx_audio_mixer_BufferMgmtFunction(), omx_base_component_DoStateSet(), omx_base_filter_BufferMgmtFunction(), omx_base_sink_BufferMgmtFunction(), omx_base_sink_twoport_BufferMgmtFunction(), omx_base_source_BufferMgmtFunction(), omx_base_source_twoport_BufferMgmtFunction(), omx_clocksrc_BufferMgmtFunction(), omx_clocksrc_component_SetConfig(), omx_video_scheduler_component_ClockPortHandleFunction(), and omx_video_scheduler_component_port_FlushProcessingBuffers().
int tsem_init | ( | tsem_t * | tsem, |
unsigned int | val ) |
Implements a simple inter-thread semaphore so not to have to deal with IPC creation and the like.
Copyright (C) 2007-2009 STMicroelectronics Copyright (C) 2007-2009 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 Initializes the semaphore at a given value
tsem | the semaphore to initialize |
val | the initial value of the semaphore |
Definition at line 39 of file tsemaphore.c.
References tsem_t::condition, tsem_t::mutex, OSCL_EXPORT_REF, and tsem_t::semval.
Referenced by base_port_Constructor(), main(), omx_base_component_Constructor(), and omx_clocksrc_component_Constructor().
void tsem_reset | ( | tsem_t * | tsem | ) |
Reset the value of the semaphore
tsem | the semaphore to reset |
Definition at line 121 of file tsemaphore.c.
References tsem_t::mutex, OSCL_EXPORT_REF, and tsem_t::semval.
Referenced by base_port_DisablePort(), base_port_FlushProcessingBuffers(), clocksrc_port_FlushProcessingBuffers(), and omx_video_scheduler_component_port_FlushProcessingBuffers().
void tsem_signal | ( | tsem_t * | tsem | ) |
Signal the condition,if waiting
tsem | the semaphore to signal |
Definition at line 141 of file tsemaphore.c.
References tsem_t::condition, tsem_t::mutex, and OSCL_EXPORT_REF.
Referenced by base_port_FlushProcessingBuffers(), clocksrc_port_FlushProcessingBuffers(), omx_base_component_DoStateSet(), and omx_video_scheduler_component_port_FlushProcessingBuffers().
int tsem_timed_down | ( | tsem_t * | tsem, |
unsigned int | milliSecondsDelay ) |
Decreases the value of the semaphore. Blocks if the semaphore value is zero. If the timeout is reached the function exits with error ETIMEDOUT
tsem | the semaphore to decrease |
timevalue | the value of delay for the timeout |
convert timeval to timespec and add delay in milliseconds for the timeout
Definition at line 69 of file tsemaphore.c.
References tsem_t::condition, err, tsem_t::mutex, OSCL_EXPORT_REF, and tsem_t::semval.
Referenced by main().
void tsem_up | ( | tsem_t * | tsem | ) |
Increases the value of the semaphore
tsem | the semaphore to increase |
Definition at line 110 of file tsemaphore.c.
References tsem_t::condition, tsem_t::mutex, OSCL_EXPORT_REF, and tsem_t::semval.
Referenced by audiomixerEventHandler(), base_clock_port_SendBufferFunction(), base_port_AllocateBuffer(), base_port_DisablePort(), base_port_EnablePort(), base_port_FlushProcessingBuffers(), base_port_FreeBuffer(), base_port_ReturnBufferFunction(), base_port_SendBufferFunction(), base_port_UseBuffer(), clocksrc_port_FlushProcessingBuffers(), omx_audio_mixer_BufferMgmtFunction(), omx_base_component_Destructor(), omx_base_component_DoStateSet(), omx_base_component_MessageHandler(), omx_base_component_SendCommand(), omx_base_filter_BufferMgmtFunction(), omx_base_sink_BufferMgmtFunction(), omx_base_sink_twoport_BufferMgmtFunction(), omx_base_source_BufferMgmtFunction(), omx_base_source_twoport_BufferMgmtFunction(), omx_clocksrc_BufferMgmtFunction(), omx_clocksrc_component_SendCommand(), omx_clocksrc_component_SetConfig(), omx_video_scheduler_component_port_FlushProcessingBuffers(), omx_video_scheduler_component_port_SendBufferFunction(), rmEventHandler(), volcEmptyBufferDone(), and volcEventHandler().
void tsem_wait | ( | tsem_t * | tsem | ) |
Wait on the condition.
tsem | the semaphore to wait |
Definition at line 131 of file tsemaphore.c.
References tsem_t::condition, tsem_t::mutex, and OSCL_EXPORT_REF.
Referenced by omx_audio_mixer_BufferMgmtFunction(), omx_base_filter_BufferMgmtFunction(), omx_base_sink_BufferMgmtFunction(), omx_base_sink_twoport_BufferMgmtFunction(), omx_base_source_BufferMgmtFunction(), and omx_base_source_twoport_BufferMgmtFunction().