cpp_mutex.h
浏览该文件的文档.
1 /*
2  * Copyright (C) 2015-2017 Alibaba Group Holding Limited
3  */
4 
5 #include <stdint.h>
6 #include <k_api.h>
7 
21 namespace AOS {
22 
23 #define Mutex_WAIT_FOREVER 0xFFFFFFFFU
24 
30  class Mutex
31  {
32  public:
38  kstat_t create(const name_t *name);
39 
45  kstat_t destroy(void);
46 
52  kstat_t lock(uint32_t millisec);
53 
59  kstat_t unlock(void);
60 
66  kmutex_t *self(void);
67 
68  private:
72  kmutex_t _mutex_def;
73  };
74 
75 }
Mutex Class.
Definition: cpp_mutex.h:31
kstat_t lock(uint32_t millisec)
This function will lock mutex
kstat_t create(const name_t *name)
This function will create a mutex
kstat_t unlock(void)
This function will unlock a mutex
kstat_t destroy(void)
This function will delete a mutex
Definition: cpp_mutex.h:21