Minor twaek to improve responsiveness on heavily loaded systems.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11550 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2001-11-27 15:51:59 +00:00
parent c64258cddf
commit 000f954c4f
3 changed files with 21 additions and 6 deletions

View file

@ -2406,12 +2406,17 @@ static void callEncoder (DOContext *ctxt)
* by setting a small delay and increasing it each time round
* so that this semi-busy wait doesn't consume too much
* processor time (I hope).
* We set an upper limit on the delay to avoid responsiveness
* problems.
*/
RELEASE(delay_date);
delay_date = [dateClass allocWithZone: NSDefaultMallocZone()];
next_interval = last_interval + delay_interval;
last_interval = delay_interval;
delay_interval = next_interval;
if (delay_interval < 1.0)
{
next_interval = last_interval + delay_interval;
last_interval = delay_interval;
delay_interval = next_interval;
}
delay_date
= [delay_date initWithTimeIntervalSinceNow: delay_interval];