public void reportError ( Throwable t ) { // set the exception, if it is the first (and the exception is non null) if ( t != null && exception . compareAndSet ( null , t ) && toInterrupt != null ) { toInterrupt . interrupt ( ) ; } }
Sets the exception and interrupts the target thread if no other exception has occurred so far .