From: David Goulet Date: Thu, 26 Jun 2014 19:07:54 +0000 (-0400) Subject: Fix: lttng-ust-jul: set thread in daemon mode X-Git-Tag: v2.4.2~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=31cf5ca34ea522f407f2fcab780c4a644f2bd15e;p=lttng-ust.git Fix: lttng-ust-jul: set thread in daemon mode This way, when the JVM stops the main thread, the agent's thread will be automatically shutdown thus making the .dispose() call optional. Signed-off-by: David Goulet Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust-jul/org/lttng/ust/jul/LTTngAgent.java b/liblttng-ust-jul/org/lttng/ust/jul/LTTngAgent.java index 2485be2d..6717cd1e 100644 --- a/liblttng-ust-jul/org/lttng/ust/jul/LTTngAgent.java +++ b/liblttng-ust-jul/org/lttng/ust/jul/LTTngAgent.java @@ -128,6 +128,7 @@ public class LTTngAgent { this.lttngThreadUser = new LTTngThread(this.sessiondAddr, this.lttngHandlerUser, this.registerSem); this.sessiondThUser = new Thread(lttngThreadUser); + this.sessiondThUser.setDaemon(true); this.sessiondThUser.start(); /* Wait for registration done of per-user sessiond */ nr_acquires++; @@ -136,6 +137,7 @@ public class LTTngAgent { this.lttngThreadRoot = new LTTngThread(this.sessiondAddr, this.lttngHandlerRoot, this.registerSem); this.sessiondThRoot = new Thread(lttngThreadRoot); + this.sessiondThRoot.setDaemon(true); this.sessiondThRoot.start(); /* Wait for registration done of system-wide sessiond */ nr_acquires++;