Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 75845 Details for
Bug 199573
Threading issues in SystemTempFileListener
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch to fix threading issues
patch199573_tempfile_threading.diff.txt (text/plain), 2.82 KB, created by
Martin Oberhuber
on 2007-08-10 10:13:52 EDT
(
hide
)
Description:
Patch to fix threading issues
Filename:
MIME Type:
Creator:
Martin Oberhuber
Created:
2007-08-10 10:13:52 EDT
Size:
2.82 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.files.ui >Index: src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java,v >retrieving revision 1.20 >diff -u -r1.20 SystemTempFileListener.java >--- src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java 25 May 2007 13:07:18 -0000 1.20 >+++ src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java 10 Aug 2007 14:12:40 -0000 >@@ -17,6 +17,7 @@ > * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() > * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry > * Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core >+ * Martin Oberhuber (Wind River) - [199573] Fix potential threading issues in SystemTempFileListener > ********************************************************************************/ > > package org.eclipse.rse.files.ui.resources; >@@ -68,7 +69,7 @@ > { > private ArrayList _changedResources; > private ArrayList _ignoredFiles = new ArrayList(); >- private boolean _isSynching; >+ private volatile boolean _isSynching; > private boolean _isEnabled; > > public SystemTempFileListener() >@@ -185,21 +186,23 @@ > public IStatus runInUIThread(IProgressMonitor monitor) > { > _isSynching = true; >- synchronized (_changedResources) >- { >+ try { >+ IFile[] filesToSync; >+ synchronized(_changedResources) { >+ filesToSync = (IFile[])_changedResources.toArray(new IFile[_changedResources.size()]); >+ _changedResources.clear(); >+ } > SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_SYNCHRONIZE_PROGRESS); > monitor.beginTask(msg.getLevelOneText(), IProgressMonitor.UNKNOWN); > setName(msg.getLevelOneText()); >- for (int i = 0; i < _changedResources.size(); i++) >+ for (int i = 0; i < filesToSync.length; i++) > { >- IFile file = (IFile) _changedResources.get(i); >- synchronizeTempWithRemote(file, monitor); >+ synchronizeTempWithRemote(filesToSync[i], monitor); > } >+ } finally { >+ _isSynching = false; > monitor.done(); >- >- _changedResources.clear(); > } >- _isSynching = false; > return Status.OK_STATUS; > } > } >@@ -382,7 +385,10 @@ > ISubSystem ss = RSECorePlugin.getTheSystemRegistry().getSubSystem(ssStr); > if (doesHandle(ss)) > { >- _changedResources.add(resource); >+ synchronized(_changedResources) { >+ //avoid ConcurrentModificationException >+ _changedResources.add(resource); >+ } > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 199573
: 75845