diff options
Diffstat (limited to 'TAO/tao/RTCORBA/RT_Mutex.cpp')
-rw-r--r-- | TAO/tao/RTCORBA/RT_Mutex.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/TAO/tao/RTCORBA/RT_Mutex.cpp b/TAO/tao/RTCORBA/RT_Mutex.cpp index c35317aade1..94bec75f82e 100644 --- a/TAO/tao/RTCORBA/RT_Mutex.cpp +++ b/TAO/tao/RTCORBA/RT_Mutex.cpp @@ -36,8 +36,10 @@ TAO_RT_Mutex::try_lock (TimeBase::TimeT wait_time, int result; if (wait_time == 0) - // No wait. - result = this->mu_.tryacquire (); + { + // No wait. + result = this->mu_.tryacquire (); + } else { // Wait for the specified amount of time before giving up. @@ -55,13 +57,18 @@ TAO_RT_Mutex::try_lock (TimeBase::TimeT wait_time, result = this->mu_.acquire (absolute_time); } - if (result == 0) + // Check result. + if (result == 0 ) return 1; - else if (result == -1 && errno == ETIME) + else + if (result == -1 + && (errno == EBUSY || errno == ETIMEDOUT)) return 0; else - // Some really bad error. - ACE_THROW_RETURN (CORBA::INTERNAL (), 0); + { + // Some really bad error. + ACE_THROW_RETURN (CORBA::INTERNAL (), 0); + } } const char * |