libmetal
Toggle main menu visibility
Loading...
Searching...
No Matches
lib
system
freertos
condition.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved.
3
*
4
* SPDX-License-Identifier: BSD-3-Clause
5
*/
6
11
12
#ifndef __METAL_CONDITION__H__
13
#error "Include metal/condition.h instead of metal/freertos/condition.h"
14
#endif
15
16
#ifndef __METAL_FREERTOS_CONDITION__H__
17
#define __METAL_FREERTOS_CONDITION__H__
18
19
#include <metal/atomic.h>
20
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
25
struct
metal_condition
{
26
metal_mutex_t
*
m
;
31
32
atomic_int
v
;
33
};
34
36
#define METAL_CONDITION_INIT { NULL, ATOMIC_VAR_INIT(0) }
37
38
static
inline
void
metal_condition_init
(
struct
metal_condition
*cv)
39
{
40
/* TODO: Implement condition variable for FreeRTOS */
41
(void)cv;
42
}
43
44
static
inline
int
metal_condition_signal
(
struct
metal_condition
*cv)
45
{
46
/* TODO: Implement condition variable for FreeRTOS */
47
(void)cv;
48
return
0;
49
}
50
51
static
inline
int
metal_condition_broadcast
(
struct
metal_condition
*cv)
52
{
53
/* TODO: Implement condition variable for FreeRTOS */
54
(void)cv;
55
return
0;
56
}
57
58
#ifdef __cplusplus
59
}
60
#endif
61
62
#endif
/* __METAL_FREERTOS_CONDITION__H__ */
atomic_int
int atomic_int
Definition
atomic.h:24
metal_condition_signal
static int metal_condition_signal(struct metal_condition *cv)
Notify one waiter. Before calling this function, the caller should have acquired the mutex.
metal_condition_broadcast
static int metal_condition_broadcast(struct metal_condition *cv)
Notify all waiters. Before calling this function, the caller should have acquired the mutex.
metal_condition_init
static void metal_condition_init(struct metal_condition *cv)
Initialize a libmetal condition variable.
metal_condition
Definition
condition.h:25
metal_condition::v
atomic_int v
Definition
condition.h:32
metal_condition::m
metal_mutex_t * m
Definition
condition.h:26
metal_mutex_t
Definition
mutex.h:28
Generated on
for libmetal by
1.17.0