From cd197e45307d9bb4db495df2f02df4fa16f804c6 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 27 Nov 2012 18:55:08 -0800 Subject: [PATCH] use Class instance for synchronization of static methods rather than creating an object only for that purpose. --- .../XWords4/src/org/eehouse/android/xw4/BoardActivity.java | 2 +- .../XWords4/src/org/eehouse/android/xw4/ConnStatusHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java index 6b2f35f51..8cd084c2e 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java @@ -167,7 +167,7 @@ public class BoardActivity extends XWActivity private boolean m_haveInvited = false; private static BoardActivity s_this = null; - private static Object s_thisLocker = new Object(); + private static Class s_thisLocker = BoardActivity.class; public static boolean feedMessage( int gameID, byte[] msg, CommsAddrRec retAddr ) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/ConnStatusHandler.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/ConnStatusHandler.java index 13c973646..8ceb78a32 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/ConnStatusHandler.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/ConnStatusHandler.java @@ -126,7 +126,7 @@ public class ConnStatusHandler { private static HashMap s_records = new HashMap(); - private static Object s_lockObj = new Object(); + private static Class s_lockObj = ConnStatusHandler.class; private static boolean s_needsSave = false; public static void setRect( int left, int top, int right, int bottom )