Use AutoTimer for SystemDependentDataBuffer
commit88048832df5e4b4e81f4f2ec258b2c04063eab14
authorJan-Marek Glogowski <glogow@fbihome.de>
Fri, 26 Apr 2019 12:59:34 +0000 (26 14:59 +0200)
committerMichael Meeks <michael.meeks@collabora.com>
Sat, 27 Apr 2019 11:22:38 +0000 (27 13:22 +0200)
tree56f1cbbeab2f792edb8052d1606630c1187e7268
parent3bf32679971804ade8e85f0e8023dc3b127cc3dc
Use AutoTimer for SystemDependentDataBuffer

This cache eviction timer is periodic, so just use an AutoTimer,
to prevent the "expensive" Start() calls. This will instantly
re-schedule the task again. OTOH Stop() is really cheap, as it
just sets a bool. Same for IsActive(), which just checks that
bool. We do lazy cleanup of stopped tasks in the scheduler.

This patch also changes the logic to just start the AutoTimer, if
it's not already running and just stops it in the timer handling
function, if there is nothing more to do. This way we can save
allmost all the previous Start() and Stop() calls, but eventually
have a single unneeded wakeup a second later.

Change-Id: Iae05483f557b94e07e51c4baae25315596923c9c
Reviewed-on: https://gerrit.libreoffice.org/71376
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
vcl/source/app/svdata.cxx
vcl/source/app/svmain.cxx