Hi Javier and other users of the Mutex class,
this is an important notice for everyone using the Mutex class.
When reviewing your recent change to FTPService, I noticed a potential
problem
with the _commandMutex in FTPService.download() and probably others:
If an exception occurs after you acquired the mutex through
_commandMutex.waitForLock(), the mutex will not be released
and thus NO MORE FTP WORK WILL BE POSSIBLE for
the rest of the Eclipse session.
YOU MUST EMBED ALL USE OF THE MUTEX in a construct
like this:
if(mutex.waitForLock() {
try {
//do some work
} finally {
mutex.release()
}
In order to ensure it is released no matter what happens.
In your case, the try...finally construct is there, but it is too late!
Everyone: Please make sure that all use of Mutex follows
this boilerplate pattern. I'm kind of sorry that this makes using
the Mutext not totally straightforward, but with the current
Java language there is no other way to properly do it --
hopefully things get better with Java7, I heard they are working
on constructs to improve this.
Tanks,
Martin
-------- Original-Nachricht --------
Update of /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/internal/services/files/ftp
In directory node2:/tmp/cvs-serv28774/src/org/eclipse/rse/internal/services/files/ftp
Modified Files:
FTPService.java
Log Message:
[187096] Drag&Drop + Copy&Paste shows error message on FTP connection
--
Martin Oberhuber
Wind River Systems, Inc.
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org/dsdp/tm
|