锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产美女精品视频免费观看,欧美啪啪一区,国产一区999http://www.shnenglu.com/bujiwu/category/11802.htmlzh-cnTue, 15 Sep 2009 15:04:33 GMTTue, 15 Sep 2009 15:04:33 GMT60- 綆鍗曠嚎紼嬪熀綾?/title>http://www.shnenglu.com/bujiwu/archive/2009/09/15/CreateThread.htmlbujiwubujiwuTue, 15 Sep 2009 13:37:00 GMThttp://www.shnenglu.com/bujiwu/archive/2009/09/15/CreateThread.htmlhttp://www.shnenglu.com/bujiwu/comments/96343.htmlhttp://www.shnenglu.com/bujiwu/archive/2009/09/15/CreateThread.html#Feedback0http://www.shnenglu.com/bujiwu/comments/commentRss/96343.htmlhttp://www.shnenglu.com/bujiwu/services/trackbacks/96343.htmlhttp://blog.csdn.net/wei801004/archive/2006/05/18/744341.aspx
http://blog.csdn.net/SeaWave/archive/2006/05/20/746399.aspx
1 #include <iostream>
2 #include <Windows.h>
3 #include <process.h>
4 #include <conio.h>
5
6 using namespace std;
7
8 class CThread
9 {
10 public:
11 CThread(void)
12 {
13 m_running = true;
14 }
15
16 virtual ~CThread(void)
17 {
18 }
19
20 void StartThread(void);
21 void StopThread(void);
22
23 void WaitForEnd(DWORD dwTimeOut = INFINITE);
24
25 virtual DWORD WINAPI ThreadWorkItem(LPVOID lpParameter) = 0;
26
27 private:
28 static DWORD WINAPI ThreadFun(LPVOID lpParameter);
29
30 protected:
31 bool m_running;
32
33 private:
34 HANDLE m_hThread;
35 };
36
37 inline void CThread::StartThread(void)
38 {
39 m_hThread = CreateThread(NULL, 0, ThreadFun, this, 0, 0);
40
41 if (m_hThread == NULL)
42 {
43 throw exception("Error: Start thread!");
44 }
45
46 CloseHandle(m_hThread);
47
48 return;
49 }
50
51 inline void CThread::WaitForEnd(DWORD dwTimeOut /* = INFINITE */)
52 {
53 DWORD dwRet = WaitForSingleObject(m_hThread, dwTimeOut);
54
55 if (dwRet == WAIT_OBJECT_0)
56 {
57 CloseHandle(m_hThread);
58 m_hThread = NULL;
59 }
60 else if (dwRet == WAIT_TIMEOUT)
61 {
62 throw exception("Error: Time out!");
63 }
64
65 return;
66 }
67
68 inline void CThread::StopThread()
69 {
70 m_running = false;
71 }
72
73 inline DWORD WINAPI CThread::ThreadFun(LPVOID lpParameter)
74 {
75 CThread *pThread = reinterpret_cast<CThread*> (lpParameter);
76 pThread->ThreadWorkItem(lpParameter);
77
78 return 0;
79 }
80
81 class SubThread : public CThread
82 {
83 public:
84 SubThread(int Num)
85 {
86 Start = Num;
87 }
88
89 DWORD WINAPI ThreadWorkItem(LPVOID lpParameter)
90 {
91 while ( m_running )
92 {
93 cout << "綰跨▼鎵ц鐨勬搷浣淸" << Start++ << "]" <<endl;
94 Sleep(1000);
95 }
96
97 ExitThread(0);
98
99 return 0;
100 }
101
102 private:
103 int Start;
104 };
105
106 int main(int argc, char* argv[])
107 {
108 SubThread MyThead(1);
109
110 cout << "To exit this server, hit a key at any time on this console
" <<endl;
111
112 MyThead.StartThread();
113 //MyThead.WaitForEnd();
114
115 while(!_kbhit())
116 {
117 Sleep(0);
118 }
119
120 MyThead.StopThread();
121
122 return 0;
123 }
124
http://www.shnenglu.com/Files/bujiwu/CThread.rar

]]>
亚洲国产精品人久久|
久久天天躁狠狠躁夜夜96流白浆|
91久久精品国产91性色也|
欧美国产精品久久高清|
日本久久久久亚洲中字幕|
欧美精品一区二区精品久久|
亚洲午夜福利精品久久|
国产精品99精品久久免费|
亚洲一区精品伊人久久伊人|
国产午夜免费高清久久影院|
欧美性猛交xxxx免费看久久久|
性高湖久久久久久久久|
精品久久久久久无码中文字幕|
久久人爽人人爽人人片AV|
香蕉久久永久视频|
精品综合久久久久久888蜜芽|
手机看片久久高清国产日韩|
成人亚洲欧美久久久久|
久久99免费视频|
久久综合亚洲欧美成人|
久久天天婷婷五月俺也去|
国产午夜精品久久久久九九电影|
99久久无码一区人妻a黑|
国产亚洲精品久久久久秋霞
|
亚洲午夜久久久|
色噜噜狠狠先锋影音久久|
精品久久香蕉国产线看观看亚洲|
久久久精品人妻一区二区三区蜜桃
|
国产成人久久激情91|
久久久久久亚洲Av无码精品专口|
久久青青草视频|
日产久久强奸免费的看|
久久精品亚洲福利|
久久人人爽人爽人人爽av|
蜜臀久久99精品久久久久久|
久久久久久无码国产精品中文字幕
|
亚洲国产成人久久精品影视|
久久精品国产亚洲综合色|
日本免费久久久久久久网站|
久久综合综合久久97色|
久久精品国产精品亚洲精品
|