} finally { myTimer.end(); } }
An InterruptTimer is not recursive. To implement recursive timers, independent InterruptTimer instances are required. A single InterruptTimer may be shared between objects which won't recursively call each other.
Each InterruptTimer spawns one background thread to sleep the specified time and interrupt the thread which called {@link #begin(int)}. It is up to the caller to ensure that the operations within the work block between the matched begin and end calls tests the interrupt flag (most IO operations do).
To terminate the background thread, use {@link #terminate()}. If the application fails to terminate the thread, it will (eventually) terminate itself when the InterruptTimer instance is garbage collected.
@see TimeoutInputStream