开发者

If a thread is waiting on a console.readline is the thread suspended?

If a thread is waiting on a co开发者_如何学JAVAnsole.readline is the thread suspended. If not what is it's state?


The thread is not suspended. It's blocked on a method call.


There's not a good way to interact (i.e. wait for user input) with the console on a thread if the user doesn't ever enter information. This question (and my answer) came up with a way to terminate the input thread by having the readline in a separate process altogether.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜