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

incorrect behavior with continuous interrupt()s to waiting thread

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3
    • None
    • 6
    • core-libs
    • x86
    • windows_2003

    Description

      When interrupt() is done for waiting thread, there is a case when InterruptedException does not
      occur, but the thread wakes up.

      REPRODUCE:
       1) Compile the attached programs
       2) Invoke java WaitTest

       According to the following portion extracted from "WaitTest.java",
       the program should not reached to (*) line.

      --- WaitTest.java --->
      ....
          int i = 0;
          while (true) {
            try {
              synchronized (target) {
                target.wait();
              }

              System.out.println("NG : " + target.isInterrupted()); <=== (*)
              System.exit(255);
            } catch (InterruptedException ie) {
      ....
      <--------------------

      However, actual message shows the program reaches to
      (*) line.

      c:\tmp> java WaitTest
       .....
      10590
      10591
      10592
      NG : true


      NOTE :
       This behavior seems to occur only in Windows and multi processor(or Hyper threading).
       This issue could not be seen in WindowsXP(single processor), Solaris9(Ultra II * 6)
       and RHEL3u5(Xeon * 2)

      Attachments

        Issue Links

          Activity

            People

              psoper Pete Soper (Inactive)
              tbaba Tadayuki Baba (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: