Changeset 14669 in josm


Ignore:
Timestamp:
2019-01-10T06:31:46+01:00 (5 years ago)
Author:
GerdP
Message:

see #13160: Avoid additional deadlocks caused by r13854 (13160-v2.patch)

This probably doesn't fix #13160 but it seems to be a good step forward.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r14613 r14669  
    2727import java.util.TreeMap;
    2828import java.util.TreeSet;
     29import java.util.concurrent.atomic.AtomicBoolean;
    2930
    3031import javax.swing.AbstractAction;
     
    10981099     */
    10991100    class AddAction extends JosmAction {
     1101        AtomicBoolean isPerforming = new AtomicBoolean(false);
    11001102        AddAction() {
    11011103            super(tr("Add"), /* ICON() */ "dialogs/add", tr("Add a new key/value pair to all objects"),
     
    11051107
    11061108        @Override
    1107         public synchronized void actionPerformed(ActionEvent e) {
    1108             if (!isEnabled())
     1109        public void actionPerformed(ActionEvent e) {
     1110            if (isPerforming.get())
    11091111                return;
    1110             setEnabled(false);
     1112            isPerforming.set(true);
    11111113            try {
    11121114                editHelper.addTag();
    11131115                btnAdd.requestFocusInWindow();
    11141116            } finally {
    1115                 setEnabled(true);
     1117                isPerforming.set(false);
    11161118            }
    11171119        }
     
    11221124     */
    11231125    class EditAction extends JosmAction implements ListSelectionListener {
     1126        AtomicBoolean isPerforming = new AtomicBoolean(false);
    11241127        EditAction() {
    11251128            super(tr("Edit"), /* ICON() */ "dialogs/edit", tr("Edit the value of the selected key for all objects"),
     
    11301133
    11311134        @Override
    1132         public synchronized void actionPerformed(ActionEvent e) {
    1133             if (!isEnabled())
     1135        public void actionPerformed(ActionEvent e) {
     1136            if (isPerforming.get())
    11341137                return;
    1135             setEnabled(false);
     1138            isPerforming.set(true);
    11361139            try {
    11371140                if (tagTable.getSelectedRowCount() == 1) {
     
    11431146                }
    11441147            } finally {
    1145                 setEnabled(true);
     1148                isPerforming.set(false);
    11461149            }
    11471150        }
Note: See TracChangeset for help on using the changeset viewer.