/[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.2 by sysadm, Sat Jul 3 09:37:58 2004 UTC Revision 1.3 by sysadm, Sat Jul 3 13:55:42 2004 UTC
# Line 19  Line 19 
19  #define TS_MAX_THREAD                   256  #define TS_MAX_THREAD                   256
20  #define TS_DEFAULT_TIMEOUT              10000  #define TS_DEFAULT_TIMEOUT              10000
21  #define TS_SETLOCK_TIMEOUT              100  #define TS_SETLOCK_TIMEOUT              100
 #define TS_SETLOCK_TIMEOUT_MAX  10000  
22    
23  class thread_pool  class thread_pool
24  {  {
# Line 44  private: Line 43  private:
43          HANDLE hThreadList[TS_MAX_THREAD];          HANDLE hThreadList[TS_MAX_THREAD];
44          thread_status uThreadStatusList[TS_MAX_THREAD];          thread_status uThreadStatusList[TS_MAX_THREAD];
45          clock_t time_status_set[TS_MAX_THREAD];          clock_t time_status_set[TS_MAX_THREAD];
46          clock_t thread_timeout;          clock_t thread_timeout[TS_MAX_THREAD];
47          bool bProcessLock;          bool bProcessLock;
48          int SetLock(bool bLock, clock_t tTimeout = TS_SETLOCK_TIMEOUT);          int SetLock(bool bLock, clock_t tTimeout = TS_SETLOCK_TIMEOUT);
49          error_code uLastErrorCode;          error_code uLastErrorCode;
50            HANDLE hThreadKiller;
51  public:  public:
52          thread_pool(UINT uThreadMax = TS_MAX_THREAD, clock_t thread_timeout = TS_DEFAULT_TIMEOUT);          thread_pool(UINT uThreadMax = TS_MAX_THREAD);
53          ~thread_pool(void);          ~thread_pool(void);
54          int GetLastError(void);          static DWORD KillDeadThread(LPVOID pParam);
55          int AddThread(HANDLE hThread);          int GetLastError(void) const;
56            int AddThread(HANDLE hThread, clock_t thread_timeout = TS_DEFAULT_TIMEOUT);
57          int RemoveThread(HANDLE hThread);          int RemoveThread(HANDLE hThread);
58          int SetThreadStatus(HANDLE hThread, int uStatus);          int SetThreadStatus(HANDLE hThread, int uStatus);
59          int GetThreadStatus(HANDLE hThread);          int GetThreadStatus(HANDLE hThread);
60          int KillDeadThread(void);          int GetThreadCount(void) const;
61            int EnableKillDeadThread(void);
62            int DisableKillDeadThread(void);
63  };  };


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

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