diff options
author | daneren2005 <daneren2005@gmail.com> | 2013-08-22 08:49:22 -0700 |
---|---|---|
committer | daneren2005 <daneren2005@gmail.com> | 2013-08-22 08:49:22 -0700 |
commit | 080bafb06fdc9a48a4f8c107addbd9e5d72fb811 (patch) | |
tree | 8c9a19c783927ba2090e2b99f58b7ad91ea22744 /src | |
parent | 17dbff4baacebb9fd52de84c7920e945384bcf17 (diff) | |
download | dsub-080bafb06fdc9a48a4f8c107addbd9e5d72fb811.tar.gz dsub-080bafb06fdc9a48a4f8c107addbd9e5d72fb811.tar.bz2 dsub-080bafb06fdc9a48a4f8c107addbd9e5d72fb811.zip |
In hindsight, don't really need to hold the lock at all, just auto release
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(); } |