From: Ian Jackson Date: Sat, 2 Apr 2011 12:38:06 +0000 (+0100) Subject: threading fixes: be properly idempotent etc. about setup - comments and extra debug... X-Git-Tag: 1.0.5~13 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=jarrg-ian.git;a=commitdiff_plain;h=9ace79319e9dc8a8e45ff7bccf0f8e6046567d0a threading fixes: be properly idempotent etc. about setup - comments and extra debug log messages --- diff --git a/src/net/chiark/yarrg/MarketUploader.java b/src/net/chiark/yarrg/MarketUploader.java index 864cf99..a6df497 100644 --- a/src/net/chiark/yarrg/MarketUploader.java +++ b/src/net/chiark/yarrg/MarketUploader.java @@ -276,11 +276,17 @@ public class MarketUploader implements Runnable, TopLevelWindowListener, GUIInit EventQueue.invokeLater(this); } + /* + * We arrange to wait for the GUI to be initialised, then look at every top-level window, + * and if it + */ public void run() { if (dtxt!=null) dtxt.println("MarketUploader run()..."); if (EventQueueMonitor.isGUIInitialized()) { + if (dtxt!=null) dtxt.println("MarketUploader GUI already ready"); guiInitialized(); } else { + if (dtxt!=null) dtxt.println("MarketUploader waiting for GUI"); EventQueueMonitor.addGUIInitializedListener(this); } } @@ -288,19 +294,25 @@ public class MarketUploader implements Runnable, TopLevelWindowListener, GUIInit public void guiInitialized() { Window ws[]= EventQueueMonitor.getTopLevelWindows(); EventQueueMonitor.addTopLevelWindowListener(this); - for (int i=0; i