Put didShutdown() in a finally block so that it is called even if
iterate() or willStart() throws some runtime exception. git-svn-id: https://samskivert.googlecode.com/svn/trunk@133 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: LoopingThread.java,v 1.1 2001/05/29 03:29:44 mdb Exp $
|
||||
// $Id: LoopingThread.java,v 1.2 2001/05/30 00:25:53 mdb Exp $
|
||||
|
||||
package com.samskivert.util;
|
||||
|
||||
@@ -34,12 +34,17 @@ public class LoopingThread extends Thread
|
||||
*/
|
||||
public void run ()
|
||||
{
|
||||
try {
|
||||
willStart();
|
||||
|
||||
while (isRunning()) {
|
||||
iterate();
|
||||
}
|
||||
|
||||
} finally {
|
||||
didShutdown();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to wake the thread up from any blocking wait that it might
|
||||
|
||||
Reference in New Issue
Block a user