Semaphore类 参考

Semaphore Class. 更多...

#include <cpp_semaphore.h>

Public 成员函数

kstat_t create (const name_t *name, sem_count_t count)
 
kstat_t destroy (void)
 
kstat_t wait (uint32_t millisec)
 
kstat_t release (void)
 
kstat_t release_all (void)
 
kstat_t count_set (sem_count_t count)
 
kstat_t count_get (sem_count_t *count)
 
ksem_t * self (void)
 

详细描述

Semaphore Class.

在文件 cpp_semaphore.h21 行定义.

成员函数说明

◆ count_get()

kstat_t count_get ( sem_count_t *  count)

This function will get count of a semaphore

参数
[out]countcount of the semaphore
返回
the operation status, RHINO_SUCCESS is OK, others is error

◆ count_set()

kstat_t count_set ( sem_count_t  count)

This function will set the count of a semaphore

参数
[in]sem_countcount of the semaphore
返回
the operation status, RHINO_SUCCESS is OK, others is error

◆ create()

kstat_t create ( const name_t *  name,
sem_count_t  count 
)

This function will create a semaphore

参数
[in]namename of the semaphore
[in]countthe init count of the semaphore
返回
the operation status, RHINO_SUCCESS is OK, others is error

◆ destroy()

kstat_t destroy ( void  )

This function will delete a semaphore

参数
[in]NULL
返回
the operation status, RHINO_SUCCESS is OK, others is error

◆ release()

kstat_t release ( void  )

This function will release a semaphore

参数
[in]NULL
返回
the operation status, RHINO_SUCCESS is OK, others is error

◆ release_all()

kstat_t release_all ( void  )

This function will release all semaphore

参数
[in]NULL
返回
the operation status, RHINO_SUCCESS is OK, others is error

◆ self()

ksem_t* self ( void  )

This function will get a Semaphore struct pointer

参数
[in]none
返回
Semaphore struct pointer

◆ wait()

kstat_t wait ( uint32_t  millisec)

This function will wait a semaphore

参数
[in]millisecmillisec to wait before take
返回
the operation status, RHINO_SUCCESS is OK, others is error

该类的文档由以下文件生成: