2021-10-26 04:24:54 -04:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2020-03-30 06:24:59 -04:00
|
|
|
|
|
|
|
#ifndef _BLE_MESH_MUTEX_H_
|
|
|
|
#define _BLE_MESH_MUTEX_H_
|
|
|
|
|
2023-08-25 02:28:44 -04:00
|
|
|
#include "mesh/kernel.h"
|
|
|
|
#include "mesh/slist.h"
|
|
|
|
#include "mesh/atomic.h"
|
2020-03-30 06:24:59 -04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
SemaphoreHandle_t mutex;
|
2020-07-03 04:33:36 -04:00
|
|
|
#if CONFIG_BLE_MESH_FREERTOS_STATIC_ALLOC
|
2020-03-30 06:24:59 -04:00
|
|
|
StaticQueue_t *buffer;
|
|
|
|
#endif
|
|
|
|
} bt_mesh_mutex_t;
|
|
|
|
|
|
|
|
void bt_mesh_mutex_create(bt_mesh_mutex_t *mutex);
|
|
|
|
void bt_mesh_mutex_free(bt_mesh_mutex_t *mutex);
|
|
|
|
void bt_mesh_mutex_lock(bt_mesh_mutex_t *mutex);
|
|
|
|
void bt_mesh_mutex_unlock(bt_mesh_mutex_t *mutex);
|
|
|
|
|
2023-08-28 04:09:37 -04:00
|
|
|
void bt_mesh_r_mutex_create(bt_mesh_mutex_t *mutex);
|
|
|
|
void bt_mesh_r_mutex_free(bt_mesh_mutex_t *mutex);
|
|
|
|
void bt_mesh_r_mutex_lock(bt_mesh_mutex_t *mutex);
|
|
|
|
void bt_mesh_r_mutex_unlock(bt_mesh_mutex_t *mutex);
|
|
|
|
|
2020-03-30 06:24:59 -04:00
|
|
|
void bt_mesh_alarm_lock(void);
|
|
|
|
void bt_mesh_alarm_unlock(void);
|
|
|
|
|
|
|
|
void bt_mesh_list_lock(void);
|
|
|
|
void bt_mesh_list_unlock(void);
|
|
|
|
|
|
|
|
void bt_mesh_buf_lock(void);
|
|
|
|
void bt_mesh_buf_unlock(void);
|
|
|
|
|
|
|
|
void bt_mesh_atomic_lock(void);
|
|
|
|
void bt_mesh_atomic_unlock(void);
|
|
|
|
|
|
|
|
void bt_mesh_mutex_init(void);
|
|
|
|
void bt_mesh_mutex_deinit(void);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _BLE_MESH_MUTEX_H_ */
|