public static @ CheckForNull Executor currentExecutor ( ) { Thread t = Thread . currentThread ( ) ; if ( t instanceof Executor ) return ( Executor ) t ; return IMPERSONATION . get ( ) ; }
Returns the executor of the current thread or null if current thread is not an executor .