/[LeafOK_CVS]/innwebd/base.cpp
ViewVC logotype

Diff of /innwebd/base.cpp

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

Revision 1.1 by sysadm, Fri Jul 2 11:22:07 2004 UTC Revision 1.2 by sysadm, Sat Jul 3 13:56:04 2004 UTC
# Line 21  Line 21 
21  using namespace std;  using namespace std;
22    
23  base::base(void)  base::base(void)
24  : innd_uid(0)  : p_ParentThread(NULL)
25    , innd_uid(0)
26  , isConnected(false)  , isConnected(false)
27  , running(false)  , running(false)
28  {  {
# Line 452  int base::s_receive(CString& out_str, co Line 453  int base::s_receive(CString& out_str, co
453          return total_read;          return total_read;
454  }  }
455    
 bool base::IsRunning(void)  
 {  
         return this->running;  
 }  
   
456  int base::begin(void)  int base::begin(void)
457  {  {
458          ULONG ulThreadId;          ULONG ulThreadId;
# Line 493  int base::begin(void) Line 489  int base::begin(void)
489    
490  DWORD base::Thread(LPVOID pParam)  DWORD base::Thread(LPVOID pParam)
491  {  {
492            HANDLE hThreadCurrent;
493          base* p;          base* p;
494    
495          syslog << logfile::log_head << "Thread started." << endl;          syslog << logfile::log_head << "Thread started." << endl;
496    
497          p = (base*)pParam;          p = (base*)pParam;
498            hThreadCurrent = GetCurrentThread();
499    
500            if (p->GetParentThread()->GetThreadPool()->AddThread(hThreadCurrent, CLOCKS_PER_SEC * 30) != 0)
501            {
502                    syslog << logfile::log_head << "Register thread ... Failed" << endl;
503            }
504            p->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WORKING);
505    
506          p->w_call();          p->w_call();
507    
508            if (p->GetParentThread()->GetThreadPool()->RemoveThread(hThreadCurrent) != 0)
509            {
510                    syslog << logfile::log_head << "Unregister thread ... Failed" << endl;
511            }
512    
513          syslog << logfile::log_head << "Thread stopped." << endl;          syslog << logfile::log_head << "Thread stopped." << endl;
514    
515          return 0;          return 0;


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

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