protected static CatalystThread getThread(ExecutorService executor) {
    final AtomicReference<CatalystThread> thread = new AtomicReference<>();
    try {
      executor.submit(() -> {
        thread.set((CatalystThread) Thread.currentThread());
      }).get();
    } catch (InterruptedException | ExecutionException e) {
      throw new IllegalStateException("failed to initialize thread state", e);
    }
    return thread.get();
  }
protected static CatalystThread getThread ( ExecutorService executor ) { final AtomicReference < CatalystThread > thread = new AtomicReference < > ( ) ; try { executor . submit ( ( ) -> { thread . set ( ( CatalystThread ) Thread . currentThread ( ) ) ; } ) . get ( ) ; } catch ( InterruptedException | ExecutionException e ) { throw new IllegalStateException ( "failed to initialize thread state" , e ) ; } return thread . get ( ) ; }
Gets the thread from a single threaded executor service.