git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@67
be28352e-c001-0410-b1a7-
c7978e42abec
*
* @return true if lock was released.
*/
- protected boolean unlockList() {
+ protected void unlockList() {
if (listlock != null) {
if (listlock.isLocked()) {
- try {
- listlock.lock.release();
- } catch (IOException e) {
- // TODO Deal with unlock Lock.release exception!
- e.printStackTrace(System.err);
- }
+ listlock.release();
}
listlock = null;
- return true;
}
- return false;
}
/**
public ClientHandle[] retrieveClientList() {
if (lockList()) {
ClientHandle[] clients = retrieveClientHandles();
- if (unlockList())
- return clients;
+ unlockList();
+ return clients;
}
return null;
}
FileWatcher w=new FileWatcher(cf);
while (cf.exists()) {
if (w.hasChanged()) {
+ ClientHandle[] cl = cfhand.retrieveClientList();
System.out.println("-- Watching "+cf.getName());
//while (w.hasChanged())
// ;
- ClientHandle[] cl = cfhand.retrieveClientList();
if (cl!=null) {
for (int chi=0,che=cl.length; chi<che; chi++) {
System.out.println("Client "+chi+" ("+cl[chi].getClientName()+" "+cl[chi].getVersion()+" "+cl[chi].getClientUrn()+")");
if (coms!=null) {
System.err.println("Unknown command : "+args[argc++] + "*Ignored!*");
};
+ for (int j=0; j<900000; j++)
+ ;
}
}