1 /*
2  * Copyright (C) 2018 Alibaba Group Holding Limited
3  */
4 
5 #ifndef MBEDTLS_THREADING_ALT_H
6 #define MBEDTLS_THREADING_ALT_H
7 
8 #include <stdlib.h>
9 #include <aos/kernel.h>
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 typedef struct
16 {
17     aos_mutex_t mutex;
18     char is_valid;
19 } mbedtls_threading_mutex_t;
20 
21 void threading_mutex_init( mbedtls_threading_mutex_t *mutex );
22 void threading_mutex_free( mbedtls_threading_mutex_t *mutex );
23 int threading_mutex_lock( mbedtls_threading_mutex_t *mutex );
24 int threading_mutex_unlock( mbedtls_threading_mutex_t *mutex );
25 
26 #ifdef __cplusplus
27 }
28 #endif
29 
30 #endif /* MBEDTLS_THREADING_ALT_H */
31