diff options
-rw-r--r-- | ace/Synch.h | 4 | ||||
-rw-r--r-- | ace/Synch.i | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/ace/Synch.h b/ace/Synch.h index c8bc1c3931d..0415cce6cd4 100644 --- a/ace/Synch.h +++ b/ace/Synch.h @@ -183,6 +183,10 @@ public: // Block the thread until the semaphore count becomes // greater than 0, then decrement it. + int acquire (ACE_Time_Value &tv); + // Block the thread until <tv> times out or until the semaphore + // count becomes greater than 0 (at which point it is decremented). + int tryacquire (void); // Conditionally decrement the semaphore if count is greater than 0 // (i.e., won't block). diff --git a/ace/Synch.i b/ace/Synch.i index 6884ef25880..905f7048820 100644 --- a/ace/Synch.i +++ b/ace/Synch.i @@ -222,6 +222,13 @@ ACE_Semaphore::acquire (void) } ACE_INLINE int +ACE_Semaphore::acquire (ACE_Time_Value &tv) +{ +// ACE_TRACE ("ACE_Semaphore::acquire"); + return ACE_OS::sema_wait (&this->semaphore_, tv); +} + +ACE_INLINE int ACE_Semaphore::tryacquire (void) { // ACE_TRACE ("ACE_Semaphore::tryacquire"); |