1 /*******************************************************************************
5 * Created : 2009-10-8 11:46:20
7 ******************************************************************************/
9 #ifndef __HLH_COND_INC_20091008_114620_HENRY__
10 #define __HLH_COND_INC_20091008_114620_HENRY__
13 /*******************************************************************************
14 * Desc : Includes Files
15 ******************************************************************************/
16 #include "utils/typedef.h"
17 #include "utils/HLH_RoundU32.h"
18 #include "utils/HLH_Time.h"
19 #include "utils/HLH_Mutex.h"
21 /*******************************************************************************
22 * Desc : Macro Definations
23 ******************************************************************************/
25 ////////////////////////////////////////////////////////////////////////////////
28 #define HLH_COND_ERR_FAILED (-1)
29 #define HLH_COND_ERR_ALREADY_INITED (-2)
30 #define HLH_COND_ERR_NOT_INIT (-3)
31 #define HLH_COND_ERR_CANT_INIT (-4)
34 /*******************************************************************************
35 * Desc : Type Definations
36 ******************************************************************************/
39 /*******************************************************************************
40 * Desc : Global Variables
41 ******************************************************************************/
47 /*******************************************************************************
49 ******************************************************************************/
55 /******************************************************************************
56 * Desc : Constructor / Deconstructor
57 ******************************************************************************/
62 /******************************************************************************
64 ******************************************************************************/
66 // Init this condition
69 // Destroy this condition
72 // Wait for this condition
73 int Wait (HLH_Mutex
&zhmMutex
);
75 // Wait for this condition util time reach
76 int TimeWait (HLH_Mutex
&zhmMutex
, const HLH_Time
&zhtTime
);
78 // Signal condition is reach
81 // Signal all the waiter condition is reach
85 /******************************************************************************
87 ******************************************************************************/
89 // Whether this instance initialized
92 // Internal condtion of HLH_Cond
93 pthread_cond_t m_cCond
;
102 #endif /* __HLH_COND_INC_20091008_114620_HENRY__ */