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

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

version 1.12, 2008/06/18 18:12:00 version 1.13, 2008/08/13 19:40:59
Line 122 
Line 122 
  
 // block until this semaphore is in a signalled state or // block until this semaphore is in a signalled state or
 // throw an exception if the wait fails // throw an exception if the wait fails
 void Semaphore::wait(Boolean ignoreInterrupt)  void Semaphore::wait()
 { {
     // Acquire mutex to enter critical section.     // Acquire mutex to enter critical section.
     pthread_mutex_lock(&_rep.mutex);     pthread_mutex_lock(&_rep.mutex);
Line 282 
Line 282 
  
 // block until this semaphore is in a signalled state, or // block until this semaphore is in a signalled state, or
 // throw an exception if the wait fails // throw an exception if the wait fails
 void Semaphore::wait(Boolean ignoreInterrupt)  void Semaphore::wait()
 { {
     do     do
     {     {
Line 290 
Line 290 
         if (rc == 0)         if (rc == 0)
             break;             break;
  
         int e = errno;          if (errno != EINTR)
         if (e == EINTR)  
         {         {
             if (ignoreInterrupt == false)              throw WaitFailed(_rep.owner);
             {  
                 throw(WaitInterrupted(_rep.owner));  
             }  
         }  
         else  
         {  
             throw(WaitFailed(_rep.owner));  
         }         }
  
         // keep going if above conditions fail         // keep going if above conditions fail
Line 398 
Line 390 
 } }
  
 // block until this semaphore is in a signalled state // block until this semaphore is in a signalled state
 // note that windows does not support interrupt  void Semaphore::wait()
 void Semaphore::wait(Boolean ignoreInterrupt)  
 { {
     DWORD errorcode = WaitForSingleObject(_rep.sem, INFINITE);     DWORD errorcode = WaitForSingleObject(_rep.sem, INFINITE);
     if (errorcode != WAIT_FAILED)     if (errorcode != WAIT_FAILED)
Line 408 
Line 399 
     }     }
     else     else
     {     {
         throw(WaitFailed(Threads::self()));          throw WaitFailed(Threads::self());
     }     }
 } }
  


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