lock.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2022 Gunar Schorcht
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
21 #ifndef DOXYGEN
22 
23 #include <stdint.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #if !defined(_RETARGETABLE_LOCKING)
30 
31 typedef void * _lock_t;
32 
33 #define _LOCK_T _lock_t
34 #define _LOCK_RECURSIVE_T _lock_t
35 
36 void _lock_init(_lock_t *lock);
37 void _lock_init_recursive(_lock_t *lock);
38 void _lock_close(_lock_t *lock);
39 void _lock_close_recursive(_lock_t *lock);
40 void _lock_acquire(_lock_t *lock);
41 void _lock_acquire_recursive(_lock_t *lock);
42 int _lock_try_acquire(_lock_t *lock);
43 int _lock_try_acquire_recursive(_lock_t *lock);
44 void _lock_release(_lock_t *lock);
45 void _lock_release_recursive(_lock_t *lock);
46 
47 #else /* !defined(_RETARGETABLE_LOCKING) */
48 
49 #include_next <sys/lock.h>
50 
51 #endif /* !defined(_RETARGETABLE_LOCKING) */
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif /* DOXYGEN */