From: jprocter Date: Thu, 27 Sep 2007 13:06:28 +0000 (+0000) Subject: hack to minimise IO interruption when SimpleClient.finalize() is called whilst docume... X-Git-Tag: Release_0.2~39 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8ac91a4d2d3909f69cfdd349f61a6d8e3559b154;p=vamsas.git hack to minimise IO interruption when SimpleClient.finalize() is called whilst document IO is being performed on the event generator thread (as currently observed in ExampleApplication) git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@481 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/src/uk/ac/vamsas/client/simpleclient/EventGeneratorThread.java b/src/uk/ac/vamsas/client/simpleclient/EventGeneratorThread.java index b9824b5..d00e119 100644 --- a/src/uk/ac/vamsas/client/simpleclient/EventGeneratorThread.java +++ b/src/uk/ac/vamsas/client/simpleclient/EventGeneratorThread.java @@ -330,7 +330,10 @@ public class EventGeneratorThread { public void interruptWatching() { if (watchThread!=null && watchThread.isAlive()) + { + // TODO: find a way of interrupting watcher in a way that prevents file IO being interrupted watchThread.interrupt(); + } } /** diff --git a/src/uk/ac/vamsas/client/simpleclient/VamsasFileWatcherThread.java b/src/uk/ac/vamsas/client/simpleclient/VamsasFileWatcherThread.java index d1b2592..56a0440 100644 --- a/src/uk/ac/vamsas/client/simpleclient/VamsasFileWatcherThread.java +++ b/src/uk/ac/vamsas/client/simpleclient/VamsasFileWatcherThread.java @@ -89,4 +89,12 @@ public class VamsasFileWatcherThread extends Thread { log.debug("Finishing WatcherThread poll loop"); running=false; } + /* (non-Javadoc) + * @see java.lang.Thread#interrupt() + */ + public void interrupt() { + // TODO: make thread gracefully interrupt watchers so that any handlers finish doing what they were doing + // super.interrupt(); + } + }