Init basesystem source codes.
[staging/basesystem.git] / nsframework / common_library / client / include / native_service / cl_sem.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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 #ifndef _cl_sem_h_  // NOLINT(build/header_guard)
17 #define _cl_sem_h_  // NOLINT(build/header_guard)
18
19 #include <semaphore.h>
20
21 #ifdef __cplusplus
22 #define EXT_C extern "C"
23 #else
24 #define EXT_C
25 #endif  // __cplusplus
26
27 /**
28  * @file cl_sem.h
29  * @brief \~english This file contains the api of sem wait.
30  */
31
32 /** @addtogroup BaseSystem
33  *  @{
34  */
35 /** @addtogroup native_service
36  *  @ingroup BaseSystem
37  *  @{
38  */
39 /** @addtogroup common_library
40  *  @ingroup native_service
41  *  @{
42  */
43
44 /////////////////////////////////////////////////////////////////////////////////////
45 /// \ingroup Sem
46 /// \~english @par Brief
47 ///      Sem wait
48 /// \~english @param [in] semid
49 ///     sem_t * - the pointer to the union sem_t
50 /// \~english @param [in] timeout
51 ///     unsigned int - the count of timeout
52 /// \~english @retval 0  Success
53 /// \~english @retval not 0 Error
54 /// \~english @par Prerequisite
55 ///     None
56 /// \~english @par Change of internal state
57 ///     None
58 /// \~english @par Conditions of processing failure
59 ///     None
60 /// \~english @par Classification
61 ///     Public
62 /// \~english @par Type
63 ///     Sync
64 /// \~english @par Detail
65 ///     None
66 /// \~english @see None
67 ////////////////////////////////////////////////////////////////////////////////////
68 EXT_C int CL_SemWait(sem_t *semid, unsigned int timeout);  // NOLINT(readability/nolint)
69
70 /** @}*/  // end of common_library
71 /** @}*/  // end of NativeService
72 /** @}*/  // end of BaseSystem
73 #endif  // #ifndef _cl_sem_h_  // NOLINT(build/header_guard)