Using "System.in.read()" to block the main thread only works if the
application is running in the foreground (user provides stdin). If
running in background or if stdin is otherwise not blocking this causes
100% cpu usage.
Fix by blocking the main thread infinitely with a condition variable.
This retains the old functionality (CTRL-C still works to quit the
application).
Using "System.in.read()" to block the main thread only works if the application is running in the foreground (user provides stdin). If running in background or if stdin is otherwise not blocking this causes 100% cpu usage.
Fix by blocking the main thread infinitely with a condition variable. This retains the old functionality (CTRL-C still works to quit the application).
Fixes #35