Actually a call to GetEnv will tell you if the thread is attached or detached. The env pointer that you pass to the function should be the same as before, but the return value will indicate that it is already attached (JNI_OK). The call will return JNI_EDETACHED if the thread is not attached and thus needs to be (in order for env to be valid).
see below
[ July 30, 2008: Message edited by: Dennis Laffey ]