Package com.packtpub.java7.concurrency.chapter5.recipe04.task

Examples of com.packtpub.java7.concurrency.chapter5.recipe04.task.Task.join()


    System.out.printf("System: %d files found.\n",results.size());
   
    results=apps.join();
    System.out.printf("Apps: %d files found.\n",results.size());
   
    results=documents.join();
    System.out.printf("Documents: %d files found.\n",results.size());
   

  }
View Full Code Here


    if (task.isCompletedAbnormally()) {
      System.out.printf("Main: An exception has ocurred\n");
      System.out.printf("Main: %s\n",task.getException());
    }
   
    System.out.printf("Main: Result: %d",task.join());
  }
}
View Full Code Here

   
   
    /*
     * Wait for the finalization of the task
     */
    task.join();
   
    /*
     * Shutdown the pool
     */
    pool.shutdown();
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.