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

Inconsistent Thread object state

XMLWordPrintable

    • sparc
    • solaris_9

      There is a race condition between sleep() and interrupt() (and possibly start()): if the timing is right, thread can enter TIMED_WAITING state and isInterrupted() will return true at the same time, which effectively renders assumption that any interrupts received before sleep() timeout will result in InterruptedException wrong.

      interrupt() happens here but the thread can react only here
                           V V
      ccccccccccccccccc1gggggggssssssssssssssssssssssssssssssssssssscc
      calculations gap sleep

            Unassigned Unassigned
            pburtnyyorcl Pavel Burtnyy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: