Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-12-02 16:50:18 -0500
committerMichael Valenta2003-12-02 16:50:18 -0500
commit00906239fcc9d53415bddd5e84e5f590d7db1973 (patch)
treec7e31bb7032efa6cb41e82fcb44f5c3108952f6f
parentae5378788a7b216d7bb764923bafe4ddcbc894c3 (diff)
downloadeclipse.platform.team-00906239fcc9d53415bddd5e84e5f590d7db1973.tar.gz
eclipse.platform.team-00906239fcc9d53415bddd5e84e5f590d7db1973.tar.xz
eclipse.platform.team-00906239fcc9d53415bddd5e84e5f590d7db1973.zip
Fix concurrency problem
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java
index dccb1b6f3..746e8ea1a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/repo/RepositoryRoot.java
@@ -112,15 +112,17 @@ public class RepositoryRoot extends PlatformObject {
private Map getDefinedModulesCache(CVSTag tag, IProgressMonitor monitor) throws CVSException {
if (modulesCache == null) {
modulesCache = new HashMap();
- try {
- ICVSRemoteResource[] folders = root.members(CVSTag.DEFAULT, true, monitor);
- for (int i = 0; i < folders.length; i++) {
- ICVSRemoteResource resource = folders[i];
- modulesCache.put(resource.getName(), resource);
+ synchronized(modulesCache) {
+ try {
+ ICVSRemoteResource[] folders = root.members(CVSTag.DEFAULT, true, monitor);
+ for (int i = 0; i < folders.length; i++) {
+ ICVSRemoteResource resource = folders[i];
+ modulesCache.put(resource.getName(), resource);
+ }
+ } catch (CVSException e) {
+ // we could't fetch the modules. Log the problem and continue
+ CVSUIPlugin.log(e);
}
- } catch (CVSException e) {
- // we could't fetch the modules. Log the problem and continue
- CVSUIPlugin.log(e);
}
}
return modulesCache;
@@ -456,7 +458,9 @@ public class RepositoryRoot extends PlatformObject {
* RepositoriesView is pressed.
*/
void clearCache() {
- modulesCache = null;
+ synchronized(modulesCache) {
+ modulesCache = null;
+ }
}
/**

Back to the top