Menu

#4 graceful termination for JConsole

None
closed
nobody
None
5
2018-08-01
2004-04-14
Barak Naveh
No

Many thanks for BeanShell - I'm using it for years and
very satisfied.

A problem that bugs me for ages is that JConsole
doesn't terminates gracefully. The inpipe watcher
thread is hanging there and prevents the application
termination. System.exit() is required to force
termination.

Attached is a source with a fix to the problem:

In constructor JConsole#JConsole(InputStream,
OutputStream) just before the end, there is thread
allocation.

Before:
// Start the inpipe watcher
new Thread( this ).start();

After:
// Start the inpipe watcher
Thread thread = new Thread( this );
thread.setDaemon(true);
thread.start();

As daemon thread, the inPipe Watcher doesn’t get in the
way when all other threads are ready to terminate.

regards,
Barak Naveh

Discussion

  • Barak Naveh

    Barak Naveh - 2004-04-14
     
  • nickl-

    nickl- - 2018-08-01
    • status: open --> closed
    • Group: -->
     
  • nickl-

    nickl- - 2018-08-01

    Ticket has been migrated to github.
    Please follow up on this over here: https://github.com/beanshell/beanshell/issues/110

     

Log in to post a comment.