DetachCurrentThread corrupts, DestroyJavaVM waits!
Hello Guys!
In my static library I create 2 threads. ThreadX and ThreadY.
BothTheadX andThreadY make JNI calls to a DLL.
ThreadX and ThreadY are as follows:
ThreadX ThreadY
- -
AttachCurrentThread AttachCurrentThread
......
JNI CallsJNI Calls
......
DetachCurrentThread DetachCurrentThread
- -
However,ThreadYexits first (i.e. callsThreadY's DetachCurrentThread), after thisThreadX's further calls to JNI fails (BAD ACCESS Error)
Any solution for this?
Nowif I remove DetachCurrentThread call from these 2 threads, then my DestroyJavaVM waits for infinite time.
And if I mistake not, even after Detaching both the Threads, DestroyJavaVM still waits for release of some more resources/handles. (not very sure about this one)
Any pointers?
Please guide!
Thanks & Regards,
Pacific

