1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-05 00:36:16 +02:00

fixed deadlock in binary tests

This commit is contained in:
David Inglis 2004-05-04 20:27:04 +00:00
parent 771e8d51cf
commit b0cedbe5cc

View file

@ -337,25 +337,26 @@ public class CDescriptorManager implements ICDescriptorManager, IResourceChangeL
public void runDescriptorOperation(IProject project, ICDescriptorOperation op, IProgressMonitor monitor) throws CoreException { public void runDescriptorOperation(IProject project, ICDescriptorOperation op, IProgressMonitor monitor) throws CoreException {
ICDescriptor descriptor = getDescriptor(project); ICDescriptor descriptor = getDescriptor(project);
CDescriptorEvent event = null;
synchronized (descriptor) { synchronized (descriptor) {
beginOperation(descriptor); beginOperation(descriptor);
try { try {
op.execute(descriptor, monitor); op.execute(descriptor, monitor);
} finally { } finally {
endOperation(descriptor); event = endOperation(descriptor);
} }
} }
if (event != null) {
fireEvent(event);
}
} }
private void beginOperation(ICDescriptor descriptor) { private void beginOperation(ICDescriptor descriptor) {
fOperationMap.put(descriptor, null); fOperationMap.put(descriptor, null);
} }
private void endOperation(ICDescriptor descriptor) { private CDescriptorEvent endOperation(ICDescriptor descriptor) {
CDescriptorEvent event = (CDescriptorEvent) fOperationMap.remove(descriptor); return (CDescriptorEvent) fOperationMap.remove(descriptor);
if (event != null) {
fireEvent(event);
}
} }
/* /*