diff options
author | Matthias Huetsch <mhu@openoffice.org> | 2003-02-10 19:40:27 +0000 |
---|---|---|
committer | Matthias Huetsch <mhu@openoffice.org> | 2003-02-10 19:40:27 +0000 |
commit | ad706e99e3ea7788773abf22d786f6a8a47ea071 (patch) | |
tree | 75737dab6b4cd4707e4e522394223bf4ecd7925a /vcl/unx | |
parent | 143edbd82668e78719fad905b8214786788993dc (diff) |
#107292# Added 'SalXLib::Wakeup()' call to 'SalXLib::StartTimer()' to
unblock 'SalXLib::Yield()' from a previous later timeout
(merged from r1.2.40.1).
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/source/app/saltimer.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/vcl/unx/source/app/saltimer.cxx b/vcl/unx/source/app/saltimer.cxx index 62f317e0a839..3cfc398130d8 100644 --- a/vcl/unx/source/app/saltimer.cxx +++ b/vcl/unx/source/app/saltimer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: saltimer.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: pl $ $Date: 2001-03-02 14:23:27 $ + * last change: $Author: mhu $ $Date: 2003-02-10 20:40:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -99,15 +99,16 @@ inline void SalXLib::StopTimer() inline void SalXLib::StartTimer( ULONG nMS ) { - gettimeofday( &Timeout_, NULL ); + timeval Timeout (Timeout_); // previous timeout. + gettimeofday (&Timeout_, 0); - nTimeoutMS_ = nMS; - Timeout_.tv_sec += nTimeoutMS_ / 1000; - Timeout_.tv_usec += nTimeoutMS_ ? (nTimeoutMS_ % 1000) * 1000 : 500; - if( Timeout_.tv_usec > 1000000 ) + nTimeoutMS_ = nMS; + Timeout_ += nTimeoutMS_; + + if ((Timeout > Timeout_) || (Timeout.tv_sec == 0)) { - Timeout_.tv_sec++; - Timeout_.tv_usec -= 1000000; + // Wakeup from previous timeout (or stopped timer). + Wakeup(); } } |