diff options
author | ralph isenmann | 2021-07-08 13:33:16 +0200 |
---|---|---|
committer | ralph isenmann | 2021-07-08 13:56:13 +0200 |
commit | 979600aafff02a83172dad80136debc54684b477 (patch) | |
tree | 5e34c4eb2e5d5c1fea9794d51a1fc8902be7717e /dozentenmodul | |
parent | [server] Refactor printing of app information from MANIFEST.MF (diff) | |
download | tutor-module-979600aafff02a83172dad80136debc54684b477.tar.gz tutor-module-979600aafff02a83172dad80136debc54684b477.tar.xz tutor-module-979600aafff02a83172dad80136debc54684b477.zip |
[client] fix blocking of dozmod during the finale state of a image download
The current thread in DownloadPanel.update() already has a lock on listeners (see TransferTask.fireEvent(..)).
super.update() tiggers an update of the GUI (awt-thread) in which a synchronized block on listeners is also entered, which results in blocking.
Now, in the case event.state == FINISHED, we want to enable the button, which is is done in an awt-thread, which is already blocking.
Diffstat (limited to 'dozentenmodul')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/DownloadPanel.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/DownloadPanel.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/DownloadPanel.java index bdf128e4..a25bd661 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/DownloadPanel.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/DownloadPanel.java @@ -56,10 +56,13 @@ public class DownloadPanel extends TransferPanel implements ActionListener, Quit @Override public void update(final TransferEvent event) { - super.update(event); + // NOTE: the update needs to be done in this order + // first enable button than update super class, + // else we will trap in a dead lock. if (event.state == TransferState.FINISHED) { btnOpenFolder.setEnabled(true); } + super.update(event); } @Override |