Code example for AtomicReference

Methods: getAndSet

0
        } 
    } 
 
    private void endThread() 
    { 
        SoftRefReleaseThread thread = softRefReleaseThread.getAndSet(null);
        if (thread != null)
        { 
            thread.requestEnd = true;
            thread.interrupt();
        } 
    } 
 
    public void putFile(final FileObject file)
    { 
        if (log.isDebugEnabled())
        { 
            log.debug("putFile: " + file.getName());
        } 
 
        Map<FileName, Reference<FileObject>> files = getOrCreateFilesystemCache(file.getFileSystem());