mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
reduce verbosity and add info to GameLock logging
This commit is contained in:
parent
de7638525a
commit
b3cce8c535
1 changed files with 9 additions and 6 deletions
|
@ -107,6 +107,9 @@ public class GameLock {
|
|||
if ( XWApp.DEBUG_LOCKS ) {
|
||||
DbgUtils.logf( "GameLock.lock() %H failed; sleeping", this );
|
||||
if ( 0 == sleptTime || sleptTime + SLEEP_TIME >= assertTime ) {
|
||||
DbgUtils.logf( "lock holding stack:", this );
|
||||
DbgUtils.printStack( m_lockTrace );
|
||||
DbgUtils.logf( "lock %H seeking stack:", this );
|
||||
DbgUtils.printStack();
|
||||
}
|
||||
}
|
||||
|
@ -127,11 +130,7 @@ public class GameLock {
|
|||
break;
|
||||
} else if ( sleptTime >= assertTime ) {
|
||||
if ( XWApp.DEBUG_LOCKS ) {
|
||||
DbgUtils.logf( "lock %H overlocked. lock holding stack:",
|
||||
this );
|
||||
DbgUtils.printStack( m_lockTrace );
|
||||
DbgUtils.logf( "lock %H seeking stack:", this );
|
||||
DbgUtils.printStack();
|
||||
DbgUtils.logf( "lock %H overlocked", this );
|
||||
}
|
||||
Assert.fail();
|
||||
}
|
||||
|
@ -167,6 +166,10 @@ public class GameLock {
|
|||
// used only for asserts
|
||||
public boolean canWrite()
|
||||
{
|
||||
return m_isForWrite && 1 == m_lockCount;
|
||||
boolean result = m_isForWrite && 1 == m_lockCount;
|
||||
if ( !result ) {
|
||||
DbgUtils.logf( "GameLock.canWrite(): %H, returning false", this
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue