From baee084a9006d99cf4993ae715c643a412cf5ad9 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 9 Apr 2016 13:34:13 -0700 Subject: [PATCH] add assert to catch case where exception may otherwise be thrown --- .../XWords4/src/org/eehouse/android/xw4/GameLock.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameLock.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameLock.java index 96dcd7a46..5bb1b6add 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameLock.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameLock.java @@ -32,7 +32,7 @@ public class GameLock { private static final boolean THROW_ON_LOCKED = true; private static final int SLEEP_TIME = 100; private static final long ASSERT_TIME = 2000; - private static final long THROW_TIME = 750; + private static final long THROW_TIME = 1000; private long m_rowid; private boolean m_isForWrite; private int m_lockCount; @@ -115,7 +115,8 @@ public class GameLock { public GameLock lock( long maxMillis ) { GameLock result = null; - Assert.assertTrue( maxMillis < ASSERT_TIME ); + Assert.assertTrue( maxMillis <= ASSERT_TIME ); + Assert.assertTrue( maxMillis <= THROW_TIME ); long sleptTime = 0; if ( DEBUG_LOCKS ) {