Mercurial > 510Connectbot
comparison src/ch/ethz/ssh2/Connection.java @ 339:cd1d87edcbf6 ganymed
fixed hang during connection, restore synchronized methods
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Thu, 31 Jul 2014 15:17:31 -0700 |
parents | 5afb8c1a54b9 |
children | b40bc65fa09a |
comparison
equal
deleted
inserted
replaced
338:126af684034e | 339:cd1d87edcbf6 |
---|---|
667 * closed, too. Can be called at any time. Don't forget to call this once | 667 * closed, too. Can be called at any time. Don't forget to call this once |
668 * you don't need a connection anymore - otherwise the receiver thread may | 668 * you don't need a connection anymore - otherwise the receiver thread may |
669 * run forever. | 669 * run forever. |
670 */ | 670 */ |
671 | 671 |
672 public void close() { | 672 public synchronized void close() { |
673 Throwable t = new Throwable("Closed due to user request."); | 673 Throwable t = new Throwable("Closed due to user request."); |
674 close(t, false); | 674 close(t, false); |
675 } | 675 } |
676 | 676 |
677 public void close(Throwable t, boolean hard) { | 677 public synchronized void close(Throwable t, boolean hard) { |
678 if (cm != null) { | 678 if (cm != null) { |
679 cm.closeAllChannels(); | 679 cm.closeAllChannels(); |
680 } | 680 } |
681 | 681 |
682 if (tm != null) { | 682 if (tm != null) { |