> From the application programmers perspective the timing of interrupts
> versus notifications are non-deterministic (not like the test cases)
Actually, even the test cases need not distinguish them.
Interrupt does not necessarily have synchronous effects. The javadoc says:
If this thread is blocked in an invocation of the wait(),
wait(long), or wait(long, int) methods of the Object class, or of
the join(), join(long), join(long, int), sleep(long), or
sleep(long, int), methods of this class, then its interrupt status
will be cleared and it will receive an InterruptedException.
If none of the previous conditions hold then this thread's
interrupt status will be set.
Note the "will"s.
A good implementation will cause the effects of interrupt to occur
sooner rather than later, but the spec allows (interrupt; notify) to
have the same observable effect as (notify; interrupt) even when both
are issued from the same thread.
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:45 EDT