Leo Li wrote:
On 10/15/07, Alexey Varlamov <[EMAIL PROTECTED]> wrote:
2007/10/15, Alexey Varlamov <[EMAIL PROTECTED]>:
<SNIP!>
The bug of RI [4] (fixed in 1.5) being referred by Oliver is a bit
wider than just printing out the stack trace. Synopsis reads:
"(thread) setUncaughtExceptionHandler() doesn't work on main thread ".
I believe this is really strong argument to use DetachCurrentThread
and be compatible with RI rather than spec (which should be fixed and
will be someday ;)
FYI, spec is indeed fixed in 1.6 :
http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/invocation.html#wp16553
The clue from the change in spec is enough to show that it is
appropriate to call DetachCurrentThread() in the main thread when
shutdowning VM.
I just checked and this bug has not been fixed in jdk 1.6 either, so it
seems that we are still expected to call DetachCurrentThread() before
DestroyJavaVM when using the RI.
Regards,
Oliver