diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java b/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java index 192ee04c..021f88d2 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java @@ -169,19 +169,12 @@ public class DownloadServiceLifecycleSupport { new Thread(new Runnable(){ @Override public void run() { - boolean locked = false; - try { - // Make sure everything is ready to go before handling event - if(!setup.get()) { - locked = true; - lock.lock(); - } - handleKeyEvent(event); - } finally { - if(locked) { - lock.unlock(); - } + if(!setup.get()) { + locked = true; + lock.lock(); + lock.unlock(); } + handleKeyEvent(event); } }).start(); } |