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

Diff for /pegasus/src/Pegasus/Common/ReadWriteSem.cpp between version 1.12 and 1.13

version 1.12, 2008/09/09 17:38:27 version 1.13, 2008/09/16 18:37:03
Line 35 
Line 35 
 #include "Time.h" #include "Time.h"
 #include "PegasusAssert.h" #include "PegasusAssert.h"
 #include "Threads.h" #include "Threads.h"
   #include "Exception.h"
   #include "System.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 63 
Line 65 
  
 void ReadWriteSem::waitRead() void ReadWriteSem::waitRead()
 { {
     if (pthread_rwlock_rdlock(&_rwlock.rwlock) != 0)      int r = pthread_rwlock_rdlock(&_rwlock.rwlock);
   
       if (r != 0)
       {
           if (r != -1)
     {     {
         throw WaitFailed(Threads::self());              // Special behavior for Single UNIX Specification, Version 3
               errno = r;
           }
   
           throw Exception(MessageLoaderParms(
               "Common.InternalException.READ_LOCK_FAILED",
               "Failed to acquire read lock: $0",
               PEGASUS_SYSTEM_ERRORMSG_NLS));
     }     }
 } }
  
 void ReadWriteSem::waitWrite() void ReadWriteSem::waitWrite()
 { {
     if (pthread_rwlock_wrlock(&_rwlock.rwlock) != 0)      int r = pthread_rwlock_wrlock(&_rwlock.rwlock);
   
       if (r != 0)
       {
           if (r != -1)
     {     {
         throw WaitFailed(Threads::self());              // Special behavior for Single UNIX Specification, Version 3
               errno = r;
           }
   
           throw Exception(MessageLoaderParms(
               "Common.InternalException.WRITE_LOCK_FAILED",
               "Failed to acquire write lock: $0",
               PEGASUS_SYSTEM_ERRORMSG_NLS));
     }     }
 } }
  
Line 117 
Line 141 
     {     {
         _rwlock._internal_lock.lock();         _rwlock._internal_lock.lock();
     }     }
     catch (IPCException &)      catch (...)
     {     {
         PEGASUS_ASSERT(0);         PEGASUS_ASSERT(0);
     }     }


Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2