// The timegraph entry list\r
private ArrayList<ControlFlowEntry> fEntryList;\r
\r
+ // The time graph entry list synchronization object\r
+ final private Object fEntryListSyncObj = new Object();\r
+\r
// The start time\r
private long fStartTime;\r
\r
\r
@Override\r
public void run() {\r
- ArrayList<ControlFlowEntry> entryList = fEntryList;\r
+ ArrayList<ControlFlowEntry> entryList = null;\r
+ synchronized (fEntryListSyncObj) {\r
+ entryList = fEntryList;\r
+ }\r
if (entryList == null) {\r
return;\r
}\r
buildTree(entryList, rootList);\r
}\r
Collections.sort(rootList, fControlFlowEntryComparator);\r
- fEntryList = rootList;\r
+ synchronized (fEntryListSyncObj) {\r
+ fEntryList = (ArrayList<ControlFlowEntry>) rootList.clone();\r
+ }\r
refresh(INITIAL_WINDOW_OFFSET);\r
}\r
for (ControlFlowEntry entry : rootList) {\r
if (fTimeGraphCombo.isDisposed()) {\r
return;\r
}\r
- ITimeGraphEntry[] entries = fEntryList.toArray(new ITimeGraphEntry[0]);\r
+ ITimeGraphEntry[] entries = null;\r
+ synchronized (fEntryListSyncObj) {\r
+ entries = fEntryList.toArray(new ITimeGraphEntry[0]);\r
+ }\r
Arrays.sort(entries, fControlFlowEntryComparator);\r
fTimeGraphCombo.setInput(entries);\r
fTimeGraphCombo.getTimeGraphViewer().setTimeBounds(fStartTime, fEndTime);\r