Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8330468

Add integrated Thread functionality for delaying thread.start().

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      A DESCRIPTION OF THE PROBLEM :
      In a scenario where a programmer wants a java.lang.Thread to begin after an arbitrary amount of milliseconds without yielding the program, the only way to do so is to start a new Thread that calls Thread.sleep() and starts the delayed thread.

      Potential Syntax:
      - thread.startIn(int milliseconds) or thread.delay(int milliseconds)

      Current implementation:
              new Thread(new Runnable() {
                  @Override
                  public void run() {
                      try{
                          Thread.sleep(8000);
                      } catch (InterruptedException e) {}
                      new Thread(runnable).start();
                  }
              }).start();


      Attachments

        Activity

          People

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: