]> gerrit.simantics Code Review - simantics/platform.git/commit
Replace OrientationRestorer TimerTask usage with ScheduledExecutor 20/1320/2
authorjsimomaa <jani.simomaa@gmail.com>
Thu, 14 Dec 2017 06:16:51 +0000 (08:16 +0200)
committerJani Simomaa <jani.simomaa@semantum.fi>
Thu, 14 Dec 2017 06:17:18 +0000 (08:17 +0200)
commit5998374f7e179cfaf451c220216adc18c823047f
treec52bcc7ae45b53b3940edbd8751a2234c26060e8
parent6fd9bc1ec7e95848d0cc15d12825a65a4b57ada5
Replace OrientationRestorer TimerTask usage with ScheduledExecutor

Timer can exhaust the system with TimerTask-runnables that are queued up
e.g. during computer hibernate and sleep. According to documentation:

If an execution is delayed for any reason (such as garbage collection or
other background activity), two or more executions will occur in rapid
succession to "catch up." In the long run, the frequency of execution
will be exactly the reciprocal of the specified period

With heavy tasks this is very bad

refs #7682

Change-Id: I5a097c8bc5e1ea2a5abe30905b2a46fa8b8386f8
bundles/org.simantics.g2d/src/org/simantics/g2d/participant/OrientationRestorer.java