synchronized (lock) { while (!newRows.isEmpty()) { model.insertRow(newRows.pop(), model.getRowCount() - 1);
@Override public void run() { if (isSampleIncluded(res)) { SamplingStatCalculator row = null; final String sampleLabel = res.getSampleLabel(useGroupName.isSelected()); synchronized (lock) { row = tableRows.get(sampleLabel); if (row == null) { row = new SamplingStatCalculator(sampleLabel); tableRows.put(row.getLabel(), row); model.insertRow(row, model.getRowCount() - 1); } } /* * Synch is needed because multiple threads can update the * counts. */ synchronized (row) { row.addSample(res); } SamplingStatCalculator tot = tableRows.get(TOTAL_ROW_LABEL); synchronized (tot) { tot.addSample(res); } model.fireTableDataChanged(); } } });
@Override public void add(SampleResult res) { if (!isSampleIncluded(res)) { return; } SamplingStatCalculator row; final String sampleLabel = res.getSampleLabel(useGroupName.isSelected()); synchronized (tableRows) { row = tableRows.get(sampleLabel); if (row == null) { row = new SamplingStatCalculator(sampleLabel); tableRows.put(row.getLabel(), row); statModel.insertRow(row, statModel.getRowCount() - 1); } } /* * Synch is needed because multiple threads can update the counts. */ synchronized (row) { row.addSample(res); } SamplingStatCalculator tot = tableRows.get(TOTAL_ROW_LABEL); synchronized (tot) { tot.addSample(res); } //statModel.fireTableDataChanged(); }
@Override public void run() { if (isSampleIncluded(res)) { SamplingStatCalculator row; final String sampleLabel = res.getSampleLabel(useGroupName.isSelected()); synchronized (lock) { row = tableRows.get(sampleLabel); if (row == null) { row = new SamplingStatCalculator(sampleLabel); tableRows.put(row.getLabel(), row); model.insertRow(row, model.getRowCount() - 1); } } /* * Synch is needed because multiple threads can update the * counts. */ synchronized (row) { row.addSample(res); } SamplingStatCalculator tot = tableRows.get(TOTAL_ROW_LABEL); synchronized (tot) { tot.addSample(res); } model.fireTableDataChanged(); } } });
@Override public void add(SampleResult res) { if (!isSampleIncluded(res)) { return; } SamplingStatCalculator row; final String sampleLabel = res.getSampleLabel(useGroupName.isSelected()); synchronized (tableRows) { row = tableRows.get(sampleLabel); if (row == null) { row = new SamplingStatCalculator(sampleLabel); tableRows.put(row.getLabel(), row); statModel.insertRow(row, statModel.getRowCount() - 1); } } /* * Synch is needed because multiple threads can update the counts. */ synchronized (row) { row.addSample(res); } SamplingStatCalculator tot = tableRows.get(TOTAL_ROW_LABEL); synchronized (tot) { tot.addSample(res); } //statModel.fireTableDataChanged(); }
synchronized (lock) { while (!newRows.isEmpty()) { model.insertRow(newRows.pop(), model.getRowCount() - 1);
synchronized (lock) { while (!newRows.isEmpty()) { model.insertRow(newRows.pop(), model.getRowCount() - 1);