diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2007-09-05 14:44:03 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2007-09-05 14:44:03 -0230 |
commit | bdcf4f222f50b915d2dfc0ea3960758adf6937db (patch) | |
tree | e263a048b6297395c97e860c87a0ca27b569cb08 /cpp/src/IceUtil/RWRecMutex.cpp | |
parent | Added missing file (diff) | |
download | ice-bdcf4f222f50b915d2dfc0ea3960758adf6937db.tar.bz2 ice-bdcf4f222f50b915d2dfc0ea3960758adf6937db.tar.xz ice-bdcf4f222f50b915d2dfc0ea3960758adf6937db.zip |
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=1351 - use monotonic timers where possible
Diffstat (limited to 'cpp/src/IceUtil/RWRecMutex.cpp')
-rw-r--r-- | cpp/src/IceUtil/RWRecMutex.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cpp/src/IceUtil/RWRecMutex.cpp b/cpp/src/IceUtil/RWRecMutex.cpp index d15d4acd98c..8f07a0dc1f0 100644 --- a/cpp/src/IceUtil/RWRecMutex.cpp +++ b/cpp/src/IceUtil/RWRecMutex.cpp @@ -89,10 +89,10 @@ IceUtil::RWRecMutex::timedReadLock(const Time& timeout) const // Wait while a writer holds the lock or while writers or an upgrader // are waiting to get the lock. // - Time end = Time::now() + timeout; + Time end = Time::now(Time::Monotonic) + timeout; while(_count < 0 || _waitingWriters != 0) { - Time remainder = end - Time::now(); + Time remainder = end - Time::now(Time::Monotonic); if(remainder > Time()) { if(_readers.timedWait(lock, remainder) == false) @@ -200,10 +200,10 @@ IceUtil::RWRecMutex::timedWriteLock(const Time& timeout) const // Wait for the lock to become available and increment the number // of waiting writers. // - Time end = Time::now() + timeout; + Time end = Time::now(Time::Monotonic) + timeout; while(_count != 0) { - Time remainder = end - Time::now(); + Time remainder = end - Time::now(Time::Monotonic); if(remainder > Time()) { ++_waitingWriters; @@ -382,10 +382,10 @@ IceUtil::RWRecMutex::timedUpgrade(const Time& timeout) const // Wait to acquire the write lock. // _upgrading = true; - Time end = Time::now() + timeout; + Time end = Time::now(Time::Monotonic) + timeout; while(_count != 0) { - Time remainder = end - Time::now(); + Time remainder = end - Time::now(Time::Monotonic); if(remainder > Time()) { ++_waitingWriters; |