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

Thread interrupt() of Thread.sleep() can be lost on Solaris due to race with signal handler

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b04
    • CPU:
      generic, sparc
    • OS:
      solaris, solaris_9

      Description

      On Solaris Thread.interrupt both sets the interrupted flag of the thread and raises a signal via thr_kill. A Thread.sleep checks the interrupt status then perform a timed-poll relying on a signal to cancel the poll and return EINTR. However, there is a race such that we can have:

            Interrupting thread Target Thread
      ---------------------------------------------------------------
                                               check interrupt flag
            set interupt flag
            thr_kill
                                                <signal delivered>
                                                poll(ms)

      The signal is delivered before the poll() and so the "sleep" continues until the specified time elapses.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fparain Frederic Parain
              Reporter:
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: