Interrupt thread of other process

我怕爱的太早我们不能终老 提交于 2019-12-11 04:24:50

问题


It may happen a thread is waiting on an object monitor and never wakes up because no other thread is notifying it (which of course is a bug...).
Using the jstack utility I see all threads and their name and status.

Is it possible to interrupt a thread (so it throws an InterruptedException) from the command line or anyway from within a different process?

I know about the https://github.com/jglick/jkillthread utility but that one simply kills the thread and I need the thread to be interrupted.

The reason for the question is that I got this situation in a production environment that I cannot simply restart....

来源:https://stackoverflow.com/questions/54331270/interrupt-thread-of-other-process

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!