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

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

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b132
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        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.

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: