When a trace is opened, a traceRangeUpdated signal is sent
asynchronously. Depending on when this thread starts running, the trace
might open and the user might close the trace before it starts.
-The trace cannot finish disposing before the signal is finished because
when it tries to dispose its analysis, they unregister themselves from
the signal manager, but TmfSignalManager.unregister is synchronized
-The signal cannot finish because it is waiting for the lock on the
analysis map (being iterated in the dispose thread).
Here is an illustration of it:
Thread 1 (dispose): > analysis map lock > waiting on signal manager lock
Thread 2 (signal) > signal manager lock > waiting on analysis map lock
Bug: 512394
Change-Id: I0f27aa6c976a54368f79cd885a561c6ce8ac3dba
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/91427
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
}
/* Clean up the analysis modules */
- synchronized (fAnalysisModules) {
- for (IAnalysisModule module : fAnalysisModules.values()) {
- module.dispose();
- }
- fAnalysisModules.clear();
+ Iterable<IAnalysisModule> analysisModules = getAnalysisModules();
+ for (IAnalysisModule module : analysisModules) {
+ module.dispose();
}
+ fAnalysisModules.clear();
super.dispose();
}