cpp_semaphore.h
浏览该文件的文档.
1 /*
2  * Copyright (C) 2015-2017 Alibaba Group Holding Limited
3  */
4 
5 #include <stdint.h>
6 #include <k_api.h>
7 
12 namespace AOS {
13 
14 #define Semaphore_WAIT_FOREVER 0xFFFFFFFFU
15 
21  class Semaphore
22  {
23  public:
30  kstat_t create(const name_t *name, sem_count_t count);
31 
37  kstat_t destroy(void);
38 
44  kstat_t wait(uint32_t millisec);
45 
51  kstat_t release(void);
52 
58  kstat_t release_all(void);
59 
65  kstat_t count_set(sem_count_t count);
66 
72  kstat_t count_get(sem_count_t *count);
73 
79  ksem_t *self(void);
80 
81  private:
85  ksem_t _sem_def;
86  };
87 
88 }
Semaphore Class.
Definition: cpp_semaphore.h:22
kstat_t release(void)
kstat_t count_set(sem_count_t count)
kstat_t wait(uint32_t millisec)
kstat_t count_get(sem_count_t *count)
kstat_t create(const name_t *name, sem_count_t count)
kstat_t destroy(void)
kstat_t release_all(void)
Definition: cpp_mutex.h:21