From e8a1e020d341991edfb858c99d65862de8ee3ffa Mon Sep 17 00:00:00 2001 From: Nick Clarke Date: Wed, 28 Jul 2010 15:34:20 +1200 Subject: [PATCH] Remove Global.dbClientWait, dbClientContinue, dbWait, dbContinue and related fields Unused since DB restructuring --- src/cx/fbn/nevernote/Global.java | 99 +++++----------------------------------- 1 file changed, 12 insertions(+), 87 deletions(-) diff --git a/src/cx/fbn/nevernote/Global.java b/src/cx/fbn/nevernote/Global.java index 3a124b5..5ae003b 100644 --- a/src/cx/fbn/nevernote/Global.java +++ b/src/cx/fbn/nevernote/Global.java @@ -28,7 +28,6 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.List; -import java.util.concurrent.ArrayBlockingQueue; import com.evernote.edam.type.Accounting; import com.evernote.edam.type.PrivilegeLevel; @@ -51,35 +50,27 @@ public class Global { public static String username = ""; public static String password = ""; - public static int mainThreadId=0; - private static ArrayBlockingQueue mainThreadWaiter = new ArrayBlockingQueue(1); + + public static final int mainThreadId=0; - public static int syncThreadId=1; - private static ArrayBlockingQueue syncThreadWaiter = new ArrayBlockingQueue(1); + public static final int syncThreadId=1; - public static int tagCounterThreadId=2; - private static ArrayBlockingQueue tagCounterThreadWaiter = new ArrayBlockingQueue(1); + public static final int tagCounterThreadId=2; - public static int trashCounterThreadId=3; // This should always be the highest thread ID - private static ArrayBlockingQueue trashCounterThreadWaiter = new ArrayBlockingQueue(1); + public static final int trashCounterThreadId=3; // This should always be the highest thread ID - public static int indexThreadId=4; // Thread for indexing words - private static ArrayBlockingQueue indexThreadWaiter = new ArrayBlockingQueue(1); + public static final int indexThreadId=4; // Thread for indexing words - public static int saveThreadId=5; // Thread used for processing data to saving content - private static ArrayBlockingQueue saveThreadWaiter = new ArrayBlockingQueue(1); + public static final int saveThreadId=5; // Thread used for processing data to saving content - public static int notebookCounterThreadId=6; // Notebook Thread - private static ArrayBlockingQueue notebookCounterThreadWaiter = new ArrayBlockingQueue(1); + public static final int notebookCounterThreadId=6; // Notebook Thread - public static int indexThread03Id=7; // unused - private static ArrayBlockingQueue indexThread03ThreadWaiter = new ArrayBlockingQueue(1); + public static final int indexThread03Id=7; // unused - public static int indexThread04Id=8; // unused - private static ArrayBlockingQueue indexThread04ThreadWaiter = new ArrayBlockingQueue(1); + public static final int indexThread04Id=8; // unused + + public static final int dbThreadId=9; // This should always be the highest thread ID - public static int dbThreadId=9; // This should always be the highest thread ID - public static HashMap passwordSafe = new HashMap(); public static List passwordRemember = new ArrayList(); @@ -898,72 +889,6 @@ public class Global { settings.endGroup(); } - public static void dbWait() { - // Global.dbThreadWait.wait(Global.dbThreadWaitMutex); - } - public static void dbContinue() { -// Global.dbThreadWait.wakeAll(); - } - - public static synchronized void dbClientWait(int id) { - if (id == mainThreadId) { - try {mainThreadWaiter.take(); } catch (InterruptedException e) {e.printStackTrace();} - } - if (id == syncThreadId) { - try {syncThreadWaiter.take();} catch (InterruptedException e) {e.printStackTrace();} - } - if (id == tagCounterThreadId) { - try {tagCounterThreadWaiter.take();} catch (InterruptedException e) {e.printStackTrace();} - } - if (id == trashCounterThreadId) { - try {trashCounterThreadWaiter.take();} catch (InterruptedException e) {e.printStackTrace();} - } - if (id == indexThreadId) { - try {indexThreadWaiter.take();} catch (InterruptedException e) {e.printStackTrace();} - } - if (id == saveThreadId) { - try {saveThreadWaiter.take();} catch (InterruptedException e) {e.printStackTrace();} - } - if (id == notebookCounterThreadId) { - try {notebookCounterThreadWaiter.take();} catch (InterruptedException e) {e.printStackTrace();} - } - if (id == indexThread03Id) { - try {indexThread03ThreadWaiter.take();} catch (InterruptedException e) {e.printStackTrace();} - } - if (id == indexThread04Id) { - try {indexThread04ThreadWaiter.take();} catch (InterruptedException e) {e.printStackTrace();} - } - } - public static void dbClientContinue(int id) { - if (id == mainThreadId) { - try { mainThreadWaiter.put(true); } catch (InterruptedException e) { e.printStackTrace();} - } - if (id == syncThreadId) { - try { syncThreadWaiter.put(true); } catch (InterruptedException e) { e.printStackTrace();} - } - if (id == tagCounterThreadId) { - try { tagCounterThreadWaiter.put(true); } catch (InterruptedException e) { e.printStackTrace();} - } - if (id == trashCounterThreadId) { - try { trashCounterThreadWaiter.put(true); } catch (InterruptedException e) { e.printStackTrace();} - } - if (id == indexThreadId) { - try { indexThreadWaiter.put(true); } catch (InterruptedException e) { e.printStackTrace();} - } - if (id == saveThreadId) { - try { saveThreadWaiter.put(true); } catch (InterruptedException e) { e.printStackTrace();} - } - if (id == notebookCounterThreadId) { - try { notebookCounterThreadWaiter.put(true); } catch (InterruptedException e) { e.printStackTrace();} - } - if (id == indexThread03Id) { - try { indexThread03ThreadWaiter.put(true); } catch (InterruptedException e) { e.printStackTrace();} - } - if (id == indexThread04Id) { - try { indexThread04ThreadWaiter.put(true); } catch (InterruptedException e) { e.printStackTrace();} - } - } - public static void saveState(String name, QByteArray state) { settings.beginGroup("SaveState"); settings.setValue(name, state); -- 2.11.0