code_app/modules/base/HGEvent.h

60 lines
1.8 KiB
C
Raw Normal View History

2022-05-03 10:25:52 +00:00
#ifndef __HGEVENT_H__
#define __HGEVENT_H__
#include "HGDef.h"
#include "HGBaseErr.h"
HG_DECLARE_HANDLE(HGEvent);
/* 创建事件
* :
* 1) manualReset: in,
* 2) initState: in,
* 3) event: out,
* :
* 1) manualReset为HGTRUE时, HGBase_WaitEvent和HGBase_WaitEventTimeout调用后,
* 2) manualReset为HGFALSE时, HGBase_WaitEvent和HGBase_WaitEventTimeout调用后,
*/
HGEXPORT HGResult HGAPI HGBase_CreateEvent(HGBool manualReset, HGBool initState, HGEvent* event);
/* 销毁事件
* :
* 1) event: in,
* :
*/
HGEXPORT HGResult HGAPI HGBase_DestroyEvent(HGEvent event);
/* 无限等待事件
* :
* 1) event: in,
* :
* 1) manualReset为HGTRUE,
*/
HGEXPORT HGResult HGAPI HGBase_WaitEvent(HGEvent event);
/* 等待事件, 带超时时间
* :
* 1) event: in,
* 2) milliseconds: in, ,
* :
* 1) milliseconds时间内如果事件有信号
* 2) , milliseconds毫秒后也立即返回, HGBASE_ERR_WAIT_TIMEOUT
* 3) manualReset为HGTRUE,
*/
HGEXPORT HGResult HGAPI HGBase_WaitEventTimeout(HGEvent event, HGUInt milliseconds);
/* 使事件有信号
* :
* 1) event: in,
* :
*/
HGEXPORT HGResult HGAPI HGBase_SetEvent(HGEvent event);
/* 使事件无信号
* :
* 1) event: in,
* :
*/
HGEXPORT HGResult HGAPI HGBase_ResetEvent(HGEvent event);
#endif /* __HGEVENT_H__ */