Mercurial > hg > release > icedtea7-2.2
changeset 2299:a8117b0af51d
Netx: make the SingleInstanceServer thread a daemon thread
2010-06-29 Omair Majid <omajid@redhat.com>
* netx/net/sourceforge/jnlp/services/XSingleInstanceService.java
(startListeningServer): Mark the thread as a daemon so the JVM can
shutdown if there are no other non-daemon thread running.
author | Omair Majid <omajid@redhat.com> |
---|---|
date | Tue, 29 Jun 2010 14:26:57 -0400 |
parents | 1a13fd8125c7 |
children | 3ac6591eded8 |
files | ChangeLog netx/net/sourceforge/jnlp/services/XSingleInstanceService.java |
diffstat | 2 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Jun 29 14:19:38 2010 -0400 +++ b/ChangeLog Tue Jun 29 14:26:57 2010 -0400 @@ -1,3 +1,9 @@ +2010-06-29 Omair Majid <omajid@redhat.com> + + * netx/net/sourceforge/jnlp/services/XSingleInstanceService.java + (startListeningServer): Mark the thread as a daemon so the JVM can + shutdown if there are no other non-daemon thread running. + 2010-06-29 Omair Majid <omajid@redhat.com> * netx/net/sourceforge/jnlp/cache/CacheUtil.java
--- a/netx/net/sourceforge/jnlp/services/XSingleInstanceService.java Tue Jun 29 14:19:38 2010 -0400 +++ b/netx/net/sourceforge/jnlp/services/XSingleInstanceService.java Tue Jun 29 14:26:57 2010 -0400 @@ -145,14 +145,21 @@ } /** - * Start the listening server to accept arguments from new isntances of + * Start the listening server to accept arguments from new instances of * applications * * @param lockFile + * the {@link SingleInstanceLock} that the server should use */ private void startListeningServer(SingleInstanceLock lockFile) { SingleInstanceServer server = new SingleInstanceServer(lockFile); - new Thread(server).start(); + Thread serverThread = new Thread(server); + /* + * mark as daemon so the JVM can shutdown if the server is the only + * thread running + */ + serverThread.setDaemon(true); + serverThread.start(); } /**