acl  3.5.3.0
fiber_cond.h
浏览该文件的文档.
1 #ifndef FIBER_COND_INCLUDE_H
2 #define FIBER_COND_INCLUDE_H
3 
4 #include "fiber_define.h"
5 #include "fiber_event.h"
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
11 /* fiber_cond.h */
12 
13 /**
14  * fiber_cond object look like pthread_cond_t which is used between threads
15  * and fibers
16  */
18 
19 /**
20  * create fiber cond which can be used in fibers more or threads mode
21  * @param flag {unsigned} current not used, just for the future extend
22  * @return {ACL_FIBER_COND *}
23  */
25 
26 /**
27  * free cond created by acl_fiber_cond_create
28  * @param cond {ACL_FIBER_COND *}
29  */
31 
32 /**
33  * wait for cond event to be signaled
34  * @param cond {ACL_FIBER_COND *}
35  * @param event {ACL_FIBER_EVENT *} must be owned by the current caller
36  * @return {int} return 0 if ok or return error value
37  */
39 
40 /**
41  * wait for cond event to be signaled with the specified timeout
42  * @param cond {ACL_FIBER_COND *}
43  * @return {int} return 0 if ok or return error value, when timedout ETIMEDOUT
44  * will be returned
45  */
47  ACL_FIBER_EVENT *event, int delay_ms);
48 
49 /**
50  * signle the cond which will wakeup one waiter for the cond to be signaled
51  * @param cond {ACL_FIBER_COND *}
52  * @return {int} return 0 if ok or return error value
53  */
55 
56 #ifdef __cplusplus
57 }
58 #endif
59 
60 #endif // !defined(_WIN32) && !defined(_WIN64)
61 
FIBER_API int acl_fiber_cond_timedwait(ACL_FIBER_COND *cond, ACL_FIBER_EVENT *event, int delay_ms)
FIBER_API void acl_fiber_cond_free(ACL_FIBER_COND *cond)
#define FIBER_API
Definition: fiber_define.h:94
FIBER_API int acl_fiber_cond_signal(ACL_FIBER_COND *cond)
FIBER_API ACL_FIBER_COND * acl_fiber_cond_create(unsigned flag)
struct ACL_FIBER_COND ACL_FIBER_COND
Definition: fiber_cond.h:17
struct ACL_FIBER_EVENT ACL_FIBER_EVENT
Definition: fiber_event.h:16
FIBER_API int acl_fiber_cond_wait(ACL_FIBER_COND *cond, ACL_FIBER_EVENT *event)