Menu

#78 NonBlockingInputStream is blocking

open
nobody
5
2013-04-08
2013-04-08
No

I think there is a problem stopping jline "externally". If deciding to stop in the main loop (same thread) as using jline, it works fine since this is the thread that has the lock in NonBlockingInputStream.

But when trying to stop (shutdown) the ConsoleReader from another thread it just hangs, since the NonBlockingInputStream is blocking (!) while waiting for input.

This seems to be caused by the ConsoleReader.readCharacter() method invoking the read method on the reader that is wrapping the NonBlockingInputStream, and thus not passing a timeout value, which effectively seems to disable the non-blocking functionality.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB