A DESCRIPTION OF THE REQUEST :
The JNI speciifcation should explicitly discuss what happens if a user invokes DetachCurrentThread() on a thread that is already detached (or has never been attached). I have seen at least one implementation that would crash when this happens.
The specification should also discuss what happens if the user invokes:
attach, attach
detach, detach
Is the thread still attached before the 2nd detach() call? That is, is there a reference count and the thread is only attached when the count drops to zero? Or is the thread detached the first time detach() is called regardless of how many times attach() was called?
Again, I have seen an implementation in that differs from Sun's and it led to problems.
JUSTIFICATION :
Improve JNI code portability by clarifying this hole in the specification