1/* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16/** 17 ************************************************************************ 18 * @file M4OSA_Semaphore.h 19 * @ingroup OSAL 20 * @brief semaphore API 21 ************************************************************************ 22*/ 23 24#ifndef M4OSA_SEMAPHORE_H 25#define M4OSA_SEMAPHORE_H 26 27#include "M4OSA_Types.h" 28#include "M4OSA_Error.h" 29 30#ifdef __cplusplus 31extern "C" 32{ 33#endif 34 35M4OSAL_REALTIME_EXPORT_TYPE M4OSA_ERR M4OSA_semaphoreOpen( M4OSA_Context* context, 36 M4OSA_UInt32 initialNumber ); 37 38 39M4OSAL_REALTIME_EXPORT_TYPE M4OSA_ERR M4OSA_semaphorePost( M4OSA_Context context ); 40 41 42M4OSAL_REALTIME_EXPORT_TYPE M4OSA_ERR M4OSA_semaphoreWait( M4OSA_Context context, 43 M4OSA_Int32 timeout ); 44 45 46M4OSAL_REALTIME_EXPORT_TYPE M4OSA_ERR M4OSA_semaphoreClose( M4OSA_Context context ); 47 48#ifdef __cplusplus 49} 50#endif 51 52 53#endif /*M4OSA_SEMAPHORE_H*/ 54 55