Bill Pugh wrote:
> There is a minor point that had been discussed before, but seems to have
> gotten left out of the public review draft.
> I am planning to add it back in:
> If thread T1 interrupts thread T2,
> there is a happens-before edge
> from the interrupted by T1
> to the point where any other thread (including T2)
> determines that T2 has been
> (by having an InterruptedException thrown
> or by invoking Thread.interruped or Thread.isInterrupted).
I'm not sure I agree that this is necessary - or necessarily a good thing.
The interrupt tells the thread to wakeup. Once the thread wakes up any
access to data shared between the interruptor and interruptee should be
correctly synchronized as normal.
What you are proposing essentially amounts to making the "interrupted"
"field" of a thread behave as a volatile - right?
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:01:00 EDT