From cc6a6139fb1ea1262976a684ad4402acb751300b Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 21 Aug 2013 20:58:58 -0700 Subject: Fix last commit --- .../daneren2005/dsub/service/DownloadServiceLifecycleSupport.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java b/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java index fa21f9f0..192ee04c 100644 --- a/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java +++ b/src/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java @@ -169,17 +169,21 @@ 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 { - lock.unlock(); + if(locked) { + lock.unlock(); + } } } - }); + }).start(); } } } -- cgit v1.2.3