1 /*******************************************************************************
2 * File Name : test/thread_test.cpp
5 * Created Time : Fri 23 Oct 2009 10:55:14 AM CST
7 ******************************************************************************/
10 /*******************************************************************************
11 * Desc : Includes Files
12 ******************************************************************************/
13 #include "src/common.h"
16 /*******************************************************************************
17 * Desc : Macro Definations
18 ******************************************************************************/
21 /*******************************************************************************
22 * Desc : Type Definations
23 ******************************************************************************/
26 /*******************************************************************************
27 * Desc : File Variables
28 ******************************************************************************/
33 /*******************************************************************************
35 ******************************************************************************/
39 /******************************************************************************
44 ******************************************************************************/
45 void * MyThreadFunc (HLH_Thread
&zhtThread
, void *pvParam
)
51 zhtThread
.ThreadStarted ();
53 nVal
= (UINT32
) pvParam
;
55 Printf ("Enter: nVal = %08X\n", nVal
);
59 zhtTime
.SetTime (2, 0);
60 HLH_Time::Wait (zhtTime
);
62 if ( zhtThread
.IsStopping () ) {
63 Printf ("Exit : nVal = %08X\n", nVal
);
72 /******************************************************************************
77 ******************************************************************************/
80 HLH_Thread zhtThread1
;
81 HLH_Thread zhtThread2
;
83 zhtThread1
.Start (MyThreadFunc
, (void*)0x1234);
84 zhtThread2
.Start (MyThreadFunc
, (void*)0x5678);
86 HLH_Time::Wait ( HLH_Time (5, 0) );
91 Printf ("Exit main\n");