garydgregory commented on issue #36: fix for VFS-662: SftpFileSystem has 
Thread-safe issue about idleChannel
URL: https://github.com/apache/commons-vfs/pull/36#issuecomment-487307909
 
 
   @qxo ,
   
   I looked at this today and was reminded that DCL is broken: 
https://www.javaworld.com/article/2074979/double-checked-locking--clever--but-broken.html
   
   I will consider this some more but there are two alternatives: synchronize 
`getChannel()` and `putChannel()` or, more simply, use eager initialization of 
the `idleChannel` ivar.
   
   _To be continued..._

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to