tmf: Make sure the request scheduler threads end gracefully
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Mon, 12 Aug 2013 21:00:46 +0000 (17:00 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Tue, 13 Aug 2013 16:58:53 +0000 (12:58 -0400)
commitb67f3f7ca0b3cb5cb8842a7c4d77e81e41a5ba52
treeb894a27a954d8bb679819ef2a1f0681eecfcac1e
parent747adf5cb7352e1eb1e7879c111d81dcd39c9c7f
tmf: Make sure the request scheduler threads end gracefully

Upon disposing a trace, the timer thread for the request executor
was not being stopped. While this was not a problem for normal Eclipse
usage, it becomes a problem when trying to run headless methods in the
tree that use the request scheduler: since some user threads were still
running, the JVM would not close and stay there waiting forever.

Additionally, mark the timer thread as a daemon thread. This is a safeguard
in case a trace is never disposed. This will let the JVM shutdown correctly
even if there are any of those threads still running.

As per the Thread.setDaemon() Javadoc:
  Marks this thread as either a daemon thread or a user thread. The Java
  Virtual Machine exits when the only threads running are all daemon threads.

Change-Id: I04e628cfd444ee86293f262017c948642619f661
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/15387
Tested-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
IP-Clean: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/request/TmfRequestExecutor.java
This page took 0.025431 seconds and 5 git commands to generate.