You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "fanshu (Jira)" <ji...@apache.org> on 2023/07/11 02:04:00 UTC

[jira] [Created] (VFS-839) SoftRefReleaseThread线程close后,不能再次自动启动

fanshu created VFS-839:
--------------------------

             Summary: SoftRefReleaseThread线程close后,不能再次自动启动
                 Key: VFS-839
                 URL: https://issues.apache.org/jira/browse/VFS-839
             Project: Commons VFS
          Issue Type: Bug
    Affects Versions: 2.7.0
            Reporter: fanshu
         Attachments: image-2023-07-11-09-19-21-597.png

当缓存的文件被全部清理后,会自动停止SoftRefReleaseThread线程,停止线程会清空fileSystemCache,softRefReleaseThread变量设为null,再将原来的线程中断,且线程安全;但是在停止SoftRefReleaseThread线程过程中,可能有新的线程从缓存获取文件,在

getOrCreateFilesystemCache方法中,当fileSystemCache为空时,会去启动新的SoftRefReleaseThread线程,但中断线程的方法还未将softRefReleaseThread变量设为null,线程不能被启动,且将fileSystem作为key放到fileSystemCache变量,非线程安全;导致SoftRefReleaseThread线程再也不能自动启动;



--
This message was sent by Atlassian Jira
(v8.20.10#820010)