public static void endTrack ( final String title ) { if ( isClosed ) { return ; } //--Make Task final long timestamp = System . currentTimeMillis ( ) ; Runnable endTrack = new Runnable ( ) { public void run ( ) { assert ! isThreaded || control . isHeldByCurrentThread ( ) ; //(check name match) String expected = titleStack . pop ( ) ; if ( ! expected . equalsIgnoreCase ( title ) ) { throw new IllegalArgumentException ( "Track names do not match: expected: " + expected + " found: " + title ) ; } //(decrement depth) depth -= 1 ; //(send signal) handlers . process ( null , MessageType . END_TRACK , depth , timestamp ) ; assert ! isThreaded || control . isHeldByCurrentThread ( ) ; } } ; //--Run Task if ( isThreaded ) { //(case: multithreaded) long threadId = Thread . currentThread ( ) . getId ( ) ; attemptThreadControl ( threadId , endTrack ) ; } else { //(case: no threading) endTrack . run ( ) ; } }
End a track ; that is return to logging at one level shallower .