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

Diff for /pegasus/src/Pegasus/Common/Mutex.h between version 1.4.2.7 and 1.4.2.8

version 1.4.2.7, 2006/07/30 23:11:55 version 1.4.2.8, 2006/07/31 17:37:18
Line 57 
Line 57 
 struct MutexRep struct MutexRep
 { {
     pthread_mutex_t mutex;     pthread_mutex_t mutex;
       int count;
 }; };
 # define PEGASUS_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER # define PEGASUS_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
 #endif #endif
Line 115 
Line 116 
 { {
 public: public:
  
     AutoMutex(Mutex& mutex, Boolean autoLock = true) :      AutoMutex(Mutex& mutex) : _mutex(mutex)
         _mutex(mutex), _locked(autoLock)  
     {     {
         if (autoLock)  
             _mutex.lock();             _mutex.lock();
     }     }
  
     ~AutoMutex()     ~AutoMutex()
     {     {
         try          _mutex.unlock();
         {  
             if (_locked)  
                 unlock();  
         }  
         catch (...)  
         {  
             // Do not propagate exception from destructor  
         }  
     }     }
  
   #if 0
     void lock()     void lock()
     {     {
         if (_locked)  
             throw AlreadyLocked(ThreadType());  
   
         _mutex.lock();         _mutex.lock();
         _locked = true;  
     }     }
  
     void unlock()     void unlock()
     {     {
         if (!_locked)  
             throw Permission(ThreadType());  
   
         _mutex.unlock();         _mutex.unlock();
         _locked = false;  
     }  
   
     Boolean isLocked() const  
     {  
         return _locked;  
     }     }
   #endif
  
 private: private:
     AutoMutex(); // Unimplemented     AutoMutex(); // Unimplemented
Line 164 
Line 144 
     AutoMutex& operator=(const AutoMutex& x); // Unimplemented     AutoMutex& operator=(const AutoMutex& x); // Unimplemented
  
     Mutex& _mutex;     Mutex& _mutex;
     Boolean _locked;  
 }; };
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.4.2.7  
changed lines
  Added in v.1.4.2.8

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2