Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FORGE-593 Converted the console input queue to a shared one.
The blocking queue in ConsoleInputSession is converted to a static shared queue to ensure that characters input by a user that are captured by an eventually terminating reader thread will not be lost (by pushing them in a per-thread queue). Instead, the characters are now pushed into a shared queue where they may be read without any loss. This is a hack to ensure that characters are not lost. Ideally, in a multiple reader thread situation, this should have been done by ensuring that the reader thread obtained just the right number of characters from System.in and eventually terminated gracefully. But, reads on System.in are blocking by nature, and Windows does not provide information on the number of characters to be read via InputStream.available(). Hence the hack.
- Loading branch information