Examples of PrimeGenerator


Examples of com.packtpub.java7.concurrency.chapter1.recipe3.task.PrimeGenerator

   * @param args
   */
  public static void main(String[] args) {

    // Launch the prime numbers generator
    Thread task=new PrimeGenerator();
    task.start();
   
    // Wait 5 seconds
    try {
      TimeUnit.SECONDS.sleep(5);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
   
    // Interrupt the prime number generator
    task.interrupt();
  }
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.