ex
Fork of mbed-os-example-mbed5-blinky by
Diff: DuerOS-Light-SDK-v1.1.0/duer-os-light/src/iot-baidu-ca/source/baidu_ca_mutex.h
- Revision:
- 47:9e361da97763
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DuerOS-Light-SDK-v1.1.0/duer-os-light/src/iot-baidu-ca/source/baidu_ca_mutex.h Tue Jul 18 16:54:45 2017 +0800 @@ -0,0 +1,40 @@ +// Copyright 2017 Baidu Inc. All Rights Reserved. +// Author: Su Hao (suhao@baidu.com) +// +// Description: Wrapper for mutex + +#ifndef BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_MUTEX_H +#define BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_MUTEX_H + +#include "baidu_ca_types.h" +#include "baidu_ca.h" + +/* + * Create mutex context + * + * @Return bca_mutex_t, the created mutex context + */ +BCA_INT bca_mutex_t bca_mutex_create(void); + +/* + * Mutex lock + * + * @Return bca_mutex_t, the mutex context + */ +BCA_INT bca_status_t bca_mutex_lock(bca_mutex_t mutex); + +/* + * Mutex unlock + * + * @Return bca_mutex_t, the mutex context + */ +BCA_INT bca_status_t bca_mutex_unlock(bca_mutex_t mutex); + +/* + * Destroy the mutex context + * + * @Return bca_mutex_t, the mutex context + */ +BCA_INT bca_status_t bca_mutex_destroy(bca_mutex_t mutex); + +#endif // BAIDU_IOT_TINYDU_IOT_OS_SRC_IOT_BAIDU_CA_SOURCE_BAIDU_CA_MUTEX_H
