TuyaOS
tuya_smartpointer.h
浏览该文件的文档.
1
11#ifndef _TUYA_SMARTPOINTER_H
12#define _TUYA_SMARTPOINTER_H
13
14#include "tuya_cloud_types.h"
15#include "tkl_mutex.h"
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
25typedef struct {
26 TKL_MUTEX_HANDLE mutex;
27 BOOL_T malk;
28 UINT_T rfc;
29 UINT_T data_len;
30 VOID_T *data;
32
42SMARTPOINTER_T *tuya_smartpointer_create(VOID *data, CONST UINT_T data_len, CONST BOOL_T malk, CONST UINT_T cnt);
43
51
61
69
70#ifdef __cplusplus
71}
72#endif /* __cplusplus */
73
74#endif
the reference data
Definition: tuya_smartpointer.h:25
Common process - adapter the mutex api provide by OS
void tuya_smartpointer_get(SMARTPOINTER_T *sp_data)
get the reference data, increase the reference
void tuya_smartpointer_put(SMARTPOINTER_T *sp_data)
put the reference data, decrease the reference
void tuya_smartpointer_del(SMARTPOINTER_T *sp_data)
delete the reference data, ignore the reference
SMARTPOINTER_T * tuya_smartpointer_create(void *data, const UINT_T data_len, const BOOL_T malk, const UINT_T cnt)
create a reference data