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

Diff for /pegasus/src/Pegasus/Common/System.cpp between version 1.77 and 1.78

version 1.77, 2009/12/15 11:39:34 version 1.78, 2010/04/09 08:23:14
Line 60 
Line 60 
  
 Boolean System::bindVerbose = false; Boolean System::bindVerbose = false;
  
   MutexType System::_mutexForGetHostName = PEGASUS_MUTEX_INITIALIZER;
   
   MutexType System::_mutexForGetFQHN = PEGASUS_MUTEX_INITIALIZER;
   
 Boolean System::copyFile(const char* fromPath, const char* toPath) Boolean System::copyFile(const char* fromPath, const char* toPath)
 { {
     ifstream is(fromPath PEGASUS_IOS_BINARY);     ifstream is(fromPath PEGASUS_IOS_BINARY);
Line 244 
Line 248 
 String System::getHostName() String System::getHostName()
 { {
     static String _hostname;     static String _hostname;
     static MutexType _mutex = PEGASUS_MUTEX_INITIALIZER;  
  
     // Use double-checked locking pattern to avoid overhead of     // Use double-checked locking pattern to avoid overhead of
     // mutex on subsequent calls.     // mutex on subsequent calls.
  
     if (0 == _hostname.size())     if (0 == _hostname.size())
     {     {
         mutex_lock(&_mutex);          mutex_lock(&_mutexForGetHostName);
  
         if (0 == _hostname.size())         if (0 == _hostname.size())
         {         {
Line 263 
Line 266 
             _hostname.assign(hostname);             _hostname.assign(hostname);
         }         }
  
         mutex_unlock(&_mutex);          mutex_unlock(&_mutexForGetHostName);
     }     }
  
     return _hostname;     return _hostname;
Line 335 
Line 338 
 String System::getFullyQualifiedHostName() String System::getFullyQualifiedHostName()
 { {
     static String _hostname;     static String _hostname;
     static MutexType _mutex = PEGASUS_MUTEX_INITIALIZER;  
   
     // Use double-checked locking pattern to avoid overhead of     // Use double-checked locking pattern to avoid overhead of
     // mutex on subsequent calls.     // mutex on subsequent calls.
  
     if (0 == _hostname.size())     if (0 == _hostname.size())
     {     {
         mutex_lock(&_mutex);          mutex_lock(&_mutexForGetFQHN);
  
         if (0 == _hostname.size())         if (0 == _hostname.size())
         {         {
Line 352 
Line 353 
             }             }
             catch (...)             catch (...)
             {             {
                 mutex_unlock(&_mutex);                  mutex_unlock(&_mutexForGetFQHN);
                 throw;                 throw;
             }             }
         }         }
  
         mutex_unlock(&_mutex);          mutex_unlock(&_mutexForGetFQHN);
     }     }
  
     return _hostname;     return _hostname;


Legend:
Removed from v.1.77  
changed lines
  Added in v.1.78

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2