(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.3 and 1.4.2.4

version 1.4.2.3, 2006/07/28 20:46:41 version 1.4.2.4, 2006/07/28 23:52:11
Line 29 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Mike Day (mdday@us.ibm.com)  // Author: Mike Brasher (m.brasher@inovadevelopment.com)
 //  
 // Modified By: Markus Mueller  
 //              Ramnath Ravindran (Ramnath.Ravindran@compaq.com)  
 //              David Eger (dteger@us.ibm.com)  
 //              Amit K Arora, IBM (amita@in.ibm.com) for PEP#101  
 //              Sean Keenan, Hewlett-Packard Company (sean.keenan@hp.com)  
 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)  
 //              David Dillard, VERITAS Software Corp.  
 //                  (david.dillard@veritas.com)  
 //              Aruran, IBM (ashanmug@in.ibm.com) for BUG# 3518  
 //  
 // Reworked By: Mike Brasher (m.brasher@inovadevelopment.com)  
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 68 
Line 56 
 { {
     pthread_mutex_t mutex;     pthread_mutex_t mutex;
     pthread_mutexattr_t attr;     pthread_mutexattr_t attr;
     ThreadType owner;  
 }; };
 inline void mutex_lock(MutexType* mutex) { pthread_mutex_lock(mutex); } inline void mutex_lock(MutexType* mutex) { pthread_mutex_lock(mutex); }
 inline void mutex_unlock(MutexType* mutex) { pthread_mutex_unlock(mutex); } inline void mutex_unlock(MutexType* mutex) { pthread_mutex_unlock(mutex); }
Line 80 
Line 67 
 struct MutexRep struct MutexRep
 { {
     MutexType handle;     MutexType handle;
     ThreadType owner;  
     size_t count;     size_t count;
 }; };
 inline void mutex_lock(MutexType* m) { WaitForSingleObject(*m, INFINITE); } inline void mutex_lock(MutexType* m) { WaitForSingleObject(*m, INFINITE); }
Line 102 
Line 88 
  
     ~Mutex();     ~Mutex();
  
     void lock(ThreadType caller = Threads::self());      void lock();
  
     void try_lock(ThreadType caller = Threads::self());      void try_lock();
  
     void timed_lock(Uint32 milliseconds, ThreadType caller = Threads::self());      void timed_lock(Uint32 milliseconds);
  
     void unlock();     void unlock();
  
     ThreadType get_owner() { return _rep.owner; }  
   
     void set_owner(ThreadType caller) { _rep.owner = caller; }  
   
 private: private:
     Mutex(const Mutex&);     Mutex(const Mutex&);
     Mutex& operator=(const Mutex&);     Mutex& operator=(const Mutex&);
Line 158 
Line 140 
     void lock()     void lock()
     {     {
         if (_locked)         if (_locked)
             throw AlreadyLocked(Threads::self());              throw AlreadyLocked(ThreadType());
  
         _mutex.lock();         _mutex.lock();
         _locked = true;         _locked = true;
Line 167 
Line 149 
     void unlock()     void unlock()
     {     {
         if (!_locked)         if (!_locked)
             throw Permission(Threads::self());              throw Permission(ThreadType());
  
         _mutex.unlock();         _mutex.unlock();
         _locked = false;         _locked = false;


Legend:
Removed from v.1.4.2.3  
changed lines
  Added in v.1.4.2.4

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2