(file) Return to Monitor.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/Monitor.cpp between version 1.19 and 1.20

version 1.19, 2002/06/07 15:17:13 version 1.20, 2002/06/07 20:52:13
Line 64 
Line 64 
  
 static struct timeval create_time = {0, 10}; static struct timeval create_time = {0, 10};
 static struct timeval destroy_time = {5, 0}; static struct timeval destroy_time = {5, 0};
 static struct timeval deadlock_time = {100, 0};  static struct timeval deadlock_time = {1000, 0};
  
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
 // //
Line 122 
Line 122 
                                      destroy_time,                                      destroy_time,
                                      deadlock_time);                                      deadlock_time);
     }     }
       else
          _thread_pool = 0;
 } }
   
 Monitor::~Monitor() Monitor::~Monitor()
 { {
     Tracer::trace(TRC_HTTP, Tracer::LEVEL4,     Tracer::trace(TRC_HTTP, Tracer::LEVEL4,
Line 142 
Line 144 
     Socket::uninitializeInterface();     Socket::uninitializeInterface();
     Tracer::trace(TRC_HTTP, Tracer::LEVEL4,     Tracer::trace(TRC_HTTP, Tracer::LEVEL4,
                   "returning from monitor destructor");                   "returning from monitor destructor");
       if(_async == false)
     delete _thread_pool;     delete _thread_pool;
 } }
  
Line 150 
Line 153 
 { {
    static struct timeval now, last;    static struct timeval now, last;
    gettimeofday(&now, NULL);    gettimeofday(&now, NULL);
      int dead_threads = 0;
  
    if( now.tv_sec - last.tv_sec > 0 )    if( now.tv_sec - last.tv_sec > 0 )
    {    {
       gettimeofday(&last, NULL);       gettimeofday(&last, NULL);
       return _thread_pool->kill_dead_threads();        try
         {
   
            dead_threads =  _thread_pool->kill_dead_threads();
    }    }
    return 0;        catch(IPCException& )
         {
         }
   
      }
      return dead_threads;
 } }
  
  
Line 170 
Line 182 
 Boolean Monitor::run(Uint32 milliseconds) Boolean Monitor::run(Uint32 milliseconds)
 { {
  
    static struct timeval now, last;  
   
 #ifdef PEGASUS_OS_TYPE_WINDOWS #ifdef PEGASUS_OS_TYPE_WINDOWS
  
     // Windows select() has a strange little bug. It returns immediately if     // Windows select() has a strange little bug. It returns immediately if
Line 187 
Line 197 
     // there were no undispatched events from last time.     // there were no undispatched events from last time.
  
     int count = 0;     int count = 0;
     pegasus_gettimeofday(&now);  
  
     memcpy(&_rep->active_rd_fd_set, &_rep->rd_fd_set, sizeof(fd_set));     memcpy(&_rep->active_rd_fd_set, &_rep->rd_fd_set, sizeof(fd_set));
 //    memcpy(&_rep->active_wr_fd_set, &_rep->wr_fd_set, sizeof(fd_set)); //    memcpy(&_rep->active_wr_fd_set, &_rep->wr_fd_set, sizeof(fd_set));
Line 206 
Line 215 
        &tv);        &tv);
     if(count == 0)     if(count == 0)
     {     {
        if( now.tv_sec - last.tv_sec > 2)  
        {  
           kill_idle_threads();  
           MessageQueueService::kill_idle_threads();  
           pegasus_gettimeofday(&last);  
        }  
        return false;        return false;
     }     }
 #ifdef PEGASUS_OS_TYPE_WINDOWS #ifdef PEGASUS_OS_TYPE_WINDOWS


Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2