public int abc()
{
ExecutorService executor = Executors.newFixedThreadPool(1);
readCmdGpio rCmdGpio = new readCmdGpio();
Future future = executor.submit(rCmdGpio);
}
private class readCmdGpio implements Callable
{
@Override
public Integer call() throws Exception {
return 0;
}
}
http://stackoverflow.com/questions/3141158/how-can-a-thread-return-a-value-after-finishing-its-jobhttp://www.journaldev.com/1069/java-thread-pool-example-using-executors-and-threadpoolexecutor
沒有留言:
張貼留言