Customer has a specific double-processor Linux machine (Linux bmjots2 2.4.26-ots #1 SMP Mon Jun 7 10:39:41 CEST 2004 i686 GNU/Linux) on which we experience the phenomenon that
System.identityHashCode(Thread.currentThread())
sometimes gives identical values when executed on different threads. (While I know that System.identityHashCode is not required to return different values for different objects, I think that the actual implementation *does* have this property, and, unfortunately, parts of StarOffice/OpenOffice rely on this. The customer uses StarOffice/OpenOffice to build his solution on top of it.)
The attached program illustrates the problem, the following output is directly from the customer:
cajus@bmjots2:~$ while true; do /opt/j2re1.4.2_04/bin/java Test2 || break; done
OK: 18464898 != 28168925
OK: 18464898 != 28168925
OK: 18464898 != 28168925
OK: 18464898 != 28168925
OK: 18464898 != 28168925
OK: 18464898 != 28168925
BUG: 18464898 == 18464898
main_thread = Thread[main,5,], cur = Thread[Thread-0,5,main], EQ ? false
cajus@bmjots2:~$
System.identityHashCode(Thread.currentThread())
sometimes gives identical values when executed on different threads. (While I know that System.identityHashCode is not required to return different values for different objects, I think that the actual implementation *does* have this property, and, unfortunately, parts of StarOffice/OpenOffice rely on this. The customer uses StarOffice/OpenOffice to build his solution on top of it.)
The attached program illustrates the problem, the following output is directly from the customer:
cajus@bmjots2:~$ while true; do /opt/j2re1.4.2_04/bin/java Test2 || break; done
OK: 18464898 != 28168925
OK: 18464898 != 28168925
OK: 18464898 != 28168925
OK: 18464898 != 28168925
OK: 18464898 != 28168925
OK: 18464898 != 28168925
BUG: 18464898 == 18464898
main_thread = Thread[main,5,], cur = Thread[Thread-0,5,main], EQ ? false
cajus@bmjots2:~$