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

(spec thread) interrupt signal issued before thread start is lost

    Details

    • Subcomponent:
    • Resolved In Build:
      b55
    • CPU:
      generic, sparc
    • OS:
      generic, solaris_2.4

      Description

      Name: akC45999 Date: 09/30/97



      Sun's jdk implementations from 1.1 to 1.2M ignore interrupt signal
      (made by interrupt() call) if it was made before thread's start.
      The specifications of java.lang.Thread does not specify such behaviour,
      so we may expect that other implementors (and jdk1.0.2 did so)
      will preserve the interrupt signal, which will lead to
      incompatibility between the Sun and other JVM vendors.

      Strictly speaking, the spec does not state that interrupt() called before start has
      effect, so some common sence is applied: if a thread can be stopped before start,
      why it can not be interrupted.
      What would the spec people say?

      // simplified version of the test
      // javasoft.sqe.tests.api.java.lang.Thread.isInterrupted0103;

      import java.io.PrintStream;

      public class isInterrupted0103 {

        public static void main(String args[]) {
      Thread thrd=new Thread();
      thrd.interrupt();//
      if (!thrd.isInterrupted()) {
      System.out.println("first interrupt signal lost");
      }
        }

      }


      Running the test:
      novo37% javac isInterrupted0103.java
      novo37% setenv CLASSPATH .
      novo37% java isInterrupted0103
      first interrupt signal lost


      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                psoper Pete Soper (Inactive)
                Reporter:
                rfqsunw Rfq Rfq (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: