Hi, my point was that if the connection was in the process of being disconnected, running a setConfig() or _write() at the same time doesn't make much sense and is at risk of producing incorrect data.
Therefore, if there is already a lock protecting _write() and setConfig(), it can make sense to re-use the same lock also for disconnect -- just to ensure that disconnect cannot happen at the same time as _write() or setConfig(). I don't think that this is a big issue, though, since the data produced by write or setConfig is doomed anyways when the connection is going down so if there are any inconsistencies those would normally not show up. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: Atsuhiko Yamanaka [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 17, 2008 2:59 AM > To: Oberhuber, Martin > Cc: [email protected] > Subject: Re: [JSch-users] JSch-0.1.37: NPE in > Session.disconnect() whencalledbefore authenticated > > Hi, > > +-From: "Oberhuber, Martin" <[EMAIL PROTECTED]> -- > |_Date: Wed, 16 Jul 2008 16:02:20 +0200 _______________________ > | > |Also, synchronizing on this seems to have the added value > |that synchronized methods "setConfig" and "_write" can > |not run concurrently. > > I'm sorry, but I could not understand above sentence. > Do you mean that nobody gets a lock for an instance of "Foo" class > if somebody has already gotten a lock for "Foo.class" object? > > > Sincerely, > -- > Atsuhiko Yamanaka > JCraft,Inc. > 1-14-20 HONCHO AOBA-KU, > SENDAI, MIYAGI 980-0014 Japan. > Tel +81-22-723-2150 > +1-415-578-3454 > Fax +81-22-224-8773 > Skype callto://jcraft/ > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ JSch-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jsch-users
