Java Thread Future invokeTask(String threadName, Callable callable)

Here you can find the source of invokeTask(String threadName, Callable callable)

Description

invoke Task

License

Open Source License

Declaration

static <T> Future<T> invokeTask(String threadName, Callable<T> callable) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.concurrent.Callable;

import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;

public class Main {
    static <T> Future<T> invokeTask(String threadName, Callable<T> callable) {
        FutureTask<T> task = new FutureTask<T>(callable);
        Thread t = new Thread(task);
        t.setName(threadName);// w  ww. j ava  2 s .  c om
        t.start();
        return task;
    }
}

Related

  1. getMinIn(Map> responses)
  2. getResults(Iterable> futures)
  3. getSilently(Future future)
  4. getSysExeNameList()
  5. getUninterruptibly(Future future)
  6. isSuccessful(CompletableFuture f)
  7. nanoTime()
  8. now(Collection> s)
  9. rollback(Object tx)