Loading...
Searching...
No Matches
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
20
21#ifndef DOXYGEN
22
23#include <stdint.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#if !defined(_RETARGETABLE_LOCKING)
30
31typedef void * _lock_t;
32
33#define _LOCK_T _lock_t
34#define _LOCK_RECURSIVE_T _lock_t
35
36void _lock_init(_lock_t *lock);
37void _lock_init_recursive(_lock_t *lock);
38void _lock_close(_lock_t *lock);
39void _lock_close_recursive(_lock_t *lock);
40void _lock_acquire(_lock_t *lock);
41void _lock_acquire_recursive(_lock_t *lock);
42int _lock_try_acquire(_lock_t *lock);
43int _lock_try_acquire_recursive(_lock_t *lock);
44void _lock_release(_lock_t *lock);
45void _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 */