JDK-6611457 : Inconsistent Thread object state
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2007-10-01
  • Updated: 2011-01-19
  • Resolved: 2007-10-03
Related Reports
Duplicate :  
Description
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