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

Diff of /innwebd/outd.cpp

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

Revision 1.1 by sysadm, Fri Jul 2 11:39:07 2004 UTC Revision 1.2 by sysadm, Sat Jul 3 05:30:04 2004 UTC
# Line 31  int outd::work() Line 31  int outd::work()
31  {  {
32          HANDLE hThreadCurrent;          HANDLE hThreadCurrent;
33          ULONG ulThreadId;          ULONG ulThreadId;
34          nntp_active* p;          base_active* p;
35          int t_count = 0;          int t_count = 0;
36    
37          if (this->running)          if (this->running)
# Line 43  int outd::work() Line 43  int outd::work()
43    
44                  while(!this->IsShutdown())                  while(!this->IsShutdown())
45                  {                  {
46                          if (t_count >= 600 && nntp_active::uThreadCount == 0)                          if (t_count >= 600 && base_active::uThreadCount == 0)
47                          {                          {
48                                  p = new nntp_active();                                  p = new base_active();
49                                  p->configure(this->innd_id,this->innd_name,this->innd_server,this->innd_uid,this->w_address,this->w_port,this->w_conn_str);                                  p->configure(this->innd_id,this->innd_name,this->innd_server,this->innd_uid,this->w_address,this->w_port,this->w_conn_str);
50    
51                                  if (hThreadCurrent = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)nntp_active::SendThread,(LPVOID)p,0,&ulThreadId))                                  if (hThreadCurrent = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)base_active::SendThread,(LPVOID)p,0,&ulThreadId))
52                                  {                                  {
53                                          nntp_active::uThreadCount++;                                          base_active::uThreadCount++;
54                                          syslog << logfile::log_head << "Create send thread ... OK" << endl;                                          syslog << logfile::log_head << "Create send thread ... OK" << endl;
55                                  }                                  }
56                                  else                                  else
# Line 64  int outd::work() Line 64  int outd::work()
64                          t_count++;                          t_count++;
65    
66                          //Terminate if timeout(5 minutes) or stopped                          //Terminate if timeout(5 minutes) or stopped
67                          if ((t_count >= 3000 || this->thread_terminate) && nntp_active::uThreadCount > 0)                          if ((t_count >= 3000 || this->thread_terminate) && base_active::uThreadCount > 0)
68                          {                          {
69                                  if (TerminateThread(hThreadCurrent,-1))                                  if (TerminateThread(hThreadCurrent,-1))
70                                  {                                  {
# Line 74  int outd::work() Line 74  int outd::work()
74                                  {                                  {
75                                          syslog << logfile::log_head << "Terminate send thread ... Failed" << endl;                                          syslog << logfile::log_head << "Terminate send thread ... Failed" << endl;
76                                  }                                  }
77                                  nntp_active::uThreadCount--;                                  base_active::uThreadCount--;
78                          }                          }
79                  }                  }
80    


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

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