You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2014/04/01 15:08:11 UTC

git commit: [KARAF-2878] The thread reading the system input stream should exit automatically when the console bundle stops

Repository: karaf
Updated Branches:
  refs/heads/master 0e4589894 -> 073490033


[KARAF-2878] The thread reading the system input stream should exit automatically when the console bundle stops


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/07349003
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/07349003
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/07349003

Branch: refs/heads/master
Commit: 07349003398602e51aee589ff8310218cc870002
Parents: 0e45898
Author: Guillaume Nodet <gn...@gmail.com>
Authored: Tue Apr 1 15:07:36 2014 +0200
Committer: Guillaume Nodet <gn...@gmail.com>
Committed: Tue Apr 1 15:08:06 2014 +0200

----------------------------------------------------------------------
 .../apache/karaf/shell/impl/console/ConsoleSessionImpl.java    | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/07349003/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
----------------------------------------------------------------------
diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
index f652a63..a284091 100644
--- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
+++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
@@ -563,6 +563,12 @@ public class ConsoleSessionImpl implements Session {
             try {
                 while (running) {
                     try {
+                        while (in.available() == 0) {
+                            if (!running) {
+                                return;
+                            }
+                            Thread.sleep(50);
+                        }
                         int c = in.read();
                         if (c == -1) {
                             return;