#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 | |
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.c.
void tsem_deinit | ( | tsem_t * | tsem | ) |
Destroy the semaphore
tsem | the semaphore to destroy |
Definition at line 52 of file src/tsemaphore.c.
Referenced by base_port_Destructor(), main(), omx_audiodec_component_Destructor(), omx_base_component_Destructor(), omx_filereader_component_Destructor(), omx_maddec_component_Destructor(), omx_parser3gp_component_Destructor(), omx_videodec_component_Destructor(), omx_videosrc_component_Destructor(), and omx_vorbisdec_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 62 of file src/tsemaphore.c.
Referenced by audiodecEventHandler(), base_port_DisablePort(), base_port_EnablePort(), base_port_FlushProcessingBuffers(), compMessageHandlerFunction(), main(), omx_audio_mixer_BufferMgmtFunction(), omx_base_component_DoStateSet(), omx_base_filter_BufferMgmtFunction(), omx_base_sink_BufferMgmtFunction(), omx_base_source_BufferMgmtFunction(), omx_base_source_twoport_BufferMgmtFunction(), omx_filereader_component_BufferMgmtCallback(), omx_parser3gp_component_BufferMgmtCallback(), omx_videodec_component_BufferMgmtCallback(), omx_videoenc_component_BufferMgmtCallback(), omx_videosrc_component_BufferMgmtCallback(), and videodecEventHandler().
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 |
Definition at line 42 of file src/tsemaphore.c.
Referenced by base_port_Constructor(), main(), omx_audiodec_component_Constructor(), omx_base_component_Constructor(), omx_filereader_component_Constructor(), omx_maddec_component_Constructor(), omx_parser3gp_component_Constructor(), omx_videodec_component_Constructor(), omx_videoenc_component_Constructor(), omx_videosrc_component_Constructor(), and omx_vorbisdec_component_Constructor().
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.
Referenced by base_port_DisablePort(), base_port_FlushProcessingBuffers(), omx_filereader_component_Deinit(), omx_parser3gp_component_Deinit(), and omx_videosrc_component_Deinit().
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.
Referenced by base_port_FlushProcessingBuffers(), and omx_base_component_DoStateSet().
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.
Referenced by alsasinkEmptyBufferDone(), alsasinkEventHandler(), audiodecEmptyBufferDone(), audiodecEventHandler(), audiomixerEmptyBufferDone(), audiomixerEventHandler(), audiosinkEmptyBufferDone(), audiosinkEventHandler(), audiosrcEventHandler(), base_port_AllocateBuffer(), base_port_DisablePort(), base_port_EnablePort(), base_port_FlushProcessingBuffers(), base_port_FreeBuffer(), base_port_ReturnBufferFunction(), base_port_SendBufferFunction(), base_port_UseBuffer(), camera_sourceEventHandler(), colorconvEmptyBufferDone(), colorconvEventHandler(), fb_sinkEmptyBufferDone(), fb_sinkEventHandler(), fbsinkEventHandler(), filereaderEventHandler(), omx_audiodec_component_ffmpegLibInit(), omx_base_component_Destructor(), omx_base_component_DoStateSet(), omx_base_component_MessageHandler(), omx_base_component_SendCommand(), omx_filereader_component_Init(), omx_maddec_component_madLibInit(), omx_parser3gp_component_Init(), omx_videodec_component_ffmpegLibInit(), omx_videoenc_component_ffmpegLibInit(), omx_videosrc_component_Init(), parser3gpEventHandler(), symbianoutputstreamEventHandler(), videodecEmptyBufferDone(), videodecEventHandler(), videoencEmptyBufferDone(), videoencEventHandler(), videosrc_port_AllocateBuffer(), videosrc_port_FreeBuffer(), videosrcEventHandler(), volcEmptyBufferDone(), volcEventHandler(), volumeEmptyBufferDone(), volumeEventHandler(), and volumeFillBufferDone().
void tsem_wait | ( | tsem_t * | tsem | ) |
Wait on the condition.
tsem | the semaphore to wait |
Definition at line 96 of file src/tsemaphore.c.
Referenced by omx_audio_mixer_BufferMgmtFunction(), omx_base_filter_BufferMgmtFunction(), omx_base_sink_BufferMgmtFunction(), omx_base_source_BufferMgmtFunction(), and omx_base_source_twoport_BufferMgmtFunction().