Skip to contentSkip to conversation

Fix: set thread in daemon mode

PATCH Mathieu Desnoyers 1 participant 1 message Jun 26, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mathieu Desnoyers

author Applied
#1 lore raw

merged, thanks!

Mathieu

----- Original Message -----

Quoted 39 lines

From: "David Goulet" <[email protected]>
To: [email protected]
Cc: "mathieu desnoyers" <[email protected]>, "David Goulet" <[email protected]>
Sent: Thursday, June 26, 2014 3:07:54 PM
Subject: [PATCH] Fix: 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.

---
 liblttng-ust-jul/org/lttng/ust/jul/LTTngAgent.java | 2 ++
 1 file changed, 2 insertions(+)
liblttng-ust-jul/org/lttng/ust/jul/LTTngAgent.java +2 -1
index 2485be2..6717cd1 100644
@@ -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++;
--

2.0.0

Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com