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

(thread) Thread doesn't terminate immediately if it was stopped before start

XMLWordPrintable

    • b132
    • generic
    • generic
    • Verified

        The CR 4519200 "(thread) Started thread does not terminate immediately if it was stopped before"
        has a Fix Delivered state, but the following example still fails:
        --------------------------------------------------------------
        public class test {
            public static void main(String[] argv) {
                A a = new A();
                a.stop();
                a.start();
                try {
                    a.join();
                } catch (Throwable e) {
                    System.out.println("Unexpected exception" + e);
                }
                if(a.state) {
                    System.out.println("Passed");
                } else {
                    System.out.println("Failed");
                }
            }
        }

        class A extends Thread {
          public volatile boolean state = true;
          public void run() {
              state = false;
          }
        }
        --------------------------------------------------------------

        The evalutation of CR 4519200 contains the following note:
        "The latency of thread stoppage will typically be 1-3 bytecodes...".

        So either the spec should mention stoppage latency or implementation
        should be fixed to terminate stopped thread immediately.

              chegar Chris Hegarty
              dmiltsov Dmitry Miltsov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: