include stack of lock owner when logging failure to lock

This commit is contained in:
Eric House 2019-02-11 07:52:22 -08:00
parent 88838d6c0c
commit 9fe01047b1
4 changed files with 15 additions and 9 deletions

View file

@ -2805,7 +2805,7 @@ public class BoardDelegate extends DelegateBase
gi = new CurGameInfo( activity ); gi = new CurGameInfo( activity );
gamePtr = GameUtils.loadMakeGame( activity, gi, lock ); gamePtr = GameUtils.loadMakeGame( activity, gi, lock );
} else { } else {
DbgUtils.toastNoLock( TAG, activity, DbgUtils.toastNoLock( TAG, activity, rowID,
"setupRematchFor(%d)", rowID ); "setupRematchFor(%d)", rowID );
} }
} }

View file

@ -57,14 +57,16 @@ public class DbgUtils {
showf( context, LocUtils.getString( context, formatid ), args ); showf( context, LocUtils.getString( context, formatid ), args );
} // showf } // showf
public static void toastNoLock( String tag, Context context, String format, public static void toastNoLock( String tag, Context context, long rowid,
Object... args ) String format, Object... args )
{ {
format = "Unable to lock game; " + format; format = "Unable to lock game; " + format;
if ( BuildConfig.DEBUG ) { if ( BuildConfig.DEBUG ) {
showf( context, format, args ); showf( context, format, args );
} }
Log.w( tag, format, args ); Log.w( tag, format, args );
Log.w( tag, "stack for lock owner for %d", rowid );
Log.w( tag, GameLock.getHolderStack( rowid ) );
} }
public static void assertOnUIThread() public static void assertOnUIThread()

View file

@ -174,8 +174,8 @@ public class GameUtils {
Utils.cancelNotification( context, (int)rowidIn ); Utils.cancelNotification( context, (int)rowidIn );
success = true; success = true;
} else { } else {
DbgUtils.toastNoLock( TAG, context, "resetGame(): rowid %d", DbgUtils.toastNoLock( TAG, context, rowidIn,
rowidIn ); "resetGame(): rowid %d", rowidIn );
} }
} }
return success; return success;
@ -309,7 +309,8 @@ public class GameUtils {
deleteGame( context, lock, informNow ); deleteGame( context, lock, informNow );
success = true; success = true;
} else { } else {
DbgUtils.toastNoLock( TAG, context, "deleteGame(): rowid %d", DbgUtils.toastNoLock( TAG, context, rowid,
"deleteGame(): rowid %d",
rowid ); rowid );
success = false; success = false;
} }
@ -971,7 +972,8 @@ public class GameUtils {
} }
} }
} catch ( GameLock.GameLockedException gle ) { } catch ( GameLock.GameLockedException gle ) {
DbgUtils.toastNoLock( TAG, context, "feedMessage(): dropping message " DbgUtils.toastNoLock( TAG, context, rowid,
"feedMessage(): dropping message "
+ " for %d", rowid ); + " for %d", rowid );
} }
} }
@ -1012,7 +1014,8 @@ public class GameUtils {
summarizeAndRelease( context, lock, gamePtr, gi ); summarizeAndRelease( context, lock, gamePtr, gi );
} else { } else {
DbgUtils.toastNoLock( TAG, context, "replaceDicts(): rowid %d", DbgUtils.toastNoLock( TAG, context, rowid,
"replaceDicts(): rowid %d",
rowid ); rowid );
} }
} }

View file

@ -142,7 +142,8 @@ abstract class XWServiceHelper {
.loadMakeGame( mService, gi, lock ); .loadMakeGame( mService, gi, lock );
gamePtr.release(); gamePtr.release();
} else { } else {
DbgUtils.toastNoLock( TAG, context, "handleInvitation()" ); DbgUtils.toastNoLock( TAG, context, rowid,
"handleInvitation()" );
} }
} }