Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to terminate Java thread gracefully

843829May 16 2002 — edited May 16 2002
Hi,

I have a Java thread running from C++ using JNI. But the java thread is connecting to a server all the time, if I want the Java thread to stop, I have to call system.exit(0), to let it terminate.

But my problem is that, system.exit(0) will terminate the C++ main thread as well. Is there anyway, that I can only terminate the Java thread without stopping the C++ thread?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 13 2002
Added on May 16 2002
3 comments
386 views