karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject git commit: [KARAF-2878] The thread reading the system input stream should exit automatically when the console bundle stops
Date Tue, 01 Apr 2014 13:08:11 GMT
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 <gnodet@gmail.com>
Authored: Tue Apr 1 15:07:36 2014 +0200
Committer: Guillaume Nodet <gnodet@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;


Mime
View raw message