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 );
gamePtr = GameUtils.loadMakeGame( activity, gi, lock );
} else {
DbgUtils.toastNoLock( TAG, activity,
DbgUtils.toastNoLock( TAG, activity, rowID,
"setupRematchFor(%d)", rowID );
}
}

View file

@ -57,14 +57,16 @@ public class DbgUtils {
showf( context, LocUtils.getString( context, formatid ), args );
} // showf
public static void toastNoLock( String tag, Context context, String format,
Object... args )
public static void toastNoLock( String tag, Context context, long rowid,
String format, Object... args )
{
format = "Unable to lock game; " + format;
if ( BuildConfig.DEBUG ) {
showf( context, 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()

View file

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

View file

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