/[LeafOK_CVS]/innwebd/thread_pool.h
ViewVC logotype

Diff of /innwebd/thread_pool.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 by sysadm, Sat Jul 3 13:55:42 2004 UTC Revision 1.7 by sysadm, Fri Apr 11 17:14:49 2008 UTC
# Line 1  Line 1 
1  /*******************************************************/  /*******************************************************/
2  /*                                                     */  /*                                                     */
3  /*  LeafOK Innd                                        */  /*  LeafOK Innbbsd                                     */
 /*  Copyright (C) LeafOK.com, 2003-2004                */  
4  /*                                                     */  /*                                                     */
5  /*  Programmed by Leaf                                 */  /*  Copyright (C) LeafOK.com, 2003-2008                */
 /*  E-mail:leaf@leafok.com  QQ:6049044                 */  
6  /*                                                     */  /*                                                     */
7  /*  http://bbs.leafok.com                              */  /*  http://www.leafok.com                              */
 /*  http://bbs.leafok.net                              */  
 /*  http://bbs.fenglin.info                            */  
8  /*                                                     */  /*                                                     */
9  /*******************************************************/  /*******************************************************/
10    
# Line 35  public: Line 31  public:
31                  E_MAX_THREAD_EXCEEDED   =       2,                  E_MAX_THREAD_EXCEEDED   =       2,
32                  E_THREAD_NOT_FOUND              =       3,                  E_THREAD_NOT_FOUND              =       3,
33                  E_INVALID_TIMEOUT               =       4,                  E_INVALID_TIMEOUT               =       4,
34                  E_KILL_THREAD_FAILED    =       5                  E_KILL_THREAD_FAILED    =       5,
35                    E_KILLER_BEGIN_FAILED   =       6,
36                    E_KILLER_END_FAILED             =       7,
37                    E_INVALID_THREAD                =       8
38          };          };
39  private:  private:
40          UINT uThreadCount;          UINT uThreadCount;
41          UINT uThreadMax;          UINT uThreadMax;
42          HANDLE hThreadList[TS_MAX_THREAD];          ULONG ulThreadIdList[TS_MAX_THREAD];
43          thread_status uThreadStatusList[TS_MAX_THREAD];          thread_status uThreadStatusList[TS_MAX_THREAD];
44          clock_t time_status_set[TS_MAX_THREAD];          clock_t time_status_set[TS_MAX_THREAD];
45          clock_t thread_timeout[TS_MAX_THREAD];          clock_t thread_timeout[TS_MAX_THREAD];
46          bool bProcessLock;          bool bProcessLock;
47          int SetLock(bool bLock, clock_t tTimeout = TS_SETLOCK_TIMEOUT);          int SetLock(bool bLock, clock_t tTimeout = TS_SETLOCK_TIMEOUT);
48          error_code uLastErrorCode;          error_code uLastErrorCode;
49          HANDLE hThreadKiller;          ULONG ulThreadKillerId;
50            bool bTerminateThreadKiller;
51  public:  public:
52          thread_pool(UINT uThreadMax = TS_MAX_THREAD);          thread_pool(UINT uThreadMax = TS_MAX_THREAD);
53          ~thread_pool(void);          ~thread_pool(void);
54          static DWORD KillDeadThread(LPVOID pParam);          static DWORD KillDeadThread(LPVOID pParam);
55          int GetLastError(void) const;          int GetLastError(void) const;
56          int AddThread(HANDLE hThread, clock_t thread_timeout = TS_DEFAULT_TIMEOUT);          int AddThread(ULONG ulThreadId, clock_t thread_timeout = TS_DEFAULT_TIMEOUT);
57          int RemoveThread(HANDLE hThread);          int RemoveThread(ULONG ulThreadId);
58          int SetThreadStatus(HANDLE hThread, int uStatus);          int SetThreadStatus(ULONG ulThreadId, int uStatus);
59          int GetThreadStatus(HANDLE hThread);          int GetThreadStatus(ULONG ulThreadId);
60          int GetThreadCount(void) const;          int GetThreadCount(void) const;
61          int EnableKillDeadThread(void);          int EnableKillDeadThread(void);
62          int DisableKillDeadThread(void);          int DisableKillDeadThread(void);
63            int KillAllThread(void);
64  };  };


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1