diff options
-rw-r--r-- | bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java index 1cc893385..f0b0ffb5c 100644 --- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/internal/reliablefile/ReliableFile.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -404,8 +404,12 @@ public class ReliableFile { CacheInfo info = new CacheInfo(FILETYPE_VALID, checksum, newFile.lastModified(), newFile.length()); cacheFiles.put(newFile, info); cleanup(generations, true); - lastGenerationFile = null; - lastGenerations = null; + if (!fileSharing) { + synchronized (lastGenerationLock) { + lastGenerationFile = null; + lastGenerations = null; + } + } } /** @@ -666,8 +670,12 @@ public class ReliableFile { ReliableFile rf = new ReliableFile(base); int[] generations = getFileGenerations(base); rf.cleanup(generations, false); - lastGenerationFile = null; - lastGenerations = null; + if (!fileSharing) { + synchronized (lastGenerationLock) { + lastGenerationFile = null; + lastGenerations = null; + } + } } /** @@ -676,8 +684,12 @@ public class ReliableFile { * @param file */ public static void fileUpdated(File file) { - lastGenerationFile = null; - lastGenerations = null; + if (!fileSharing) { + synchronized (lastGenerationLock) { + lastGenerationFile = null; + lastGenerations = null; + } + } } /** |