cleanup/improve logging

This commit is contained in:
Eric House 2013-06-26 00:36:02 -07:00
parent d7f8e8e198
commit 909640c82f
2 changed files with 8 additions and 5 deletions

View file

@ -89,10 +89,11 @@ CidLock::print_claimed( const char* caller )
#endif
CidInfo*
CidLock::Claim( CookieID cid )
CidLock::Claim( const CookieID origCid )
{
CookieID cid = origCid;
#ifdef CIDLOCK_DEBUG
logf( XW_LOGINFO, "%s(%d)", __func__, cid );
logf( XW_LOGINFO, "%s(%d)", __func__, origCid );
#endif
CidInfo* info = NULL;
pthread_t self = pthread_self();
@ -127,7 +128,7 @@ CidLock::Claim( CookieID cid )
pthread_cond_wait( &m_infos_condvar, &m_infos_mutex );
}
#ifdef CIDLOCK_DEBUG
logf( XW_LOGINFO, "%s(%d): DONE", __func__, cid );
logf( XW_LOGINFO, "%s(%d): DONE", __func__, origCid );
#endif
return info;
} /* CidLock::Claim */
@ -191,7 +192,8 @@ CidLock::Relinquish( CidInfo* claim, bool drop )
assert( claim->GetOwner() == pthread_self() );
if ( drop ) {
#ifdef CIDLOCK_DEBUG
logf( XW_LOGINFO, "%s: deleting %p", __func__, iter->second );
logf( XW_LOGINFO, "%s: deleting %p (cid=%d)",
__func__, claim, claim->GetCid() );
#endif
m_infos.erase( iter );
claim->SetOwner( 0 );

View file

@ -225,7 +225,8 @@ XWThreadPool::IsCurrent( const AddrInfo* addr )
assert( !sockFound );
sockFound = true;
result = iter->second.m_addr.created() <= addr->created();
logf( XW_LOGINFO, "%s(sock=%d)=>%d (%lx vs %lx)", __func__, sock, result,
logf( XW_LOGINFO, "%s(sock=%d)=>%d (%lx vs %lx)",
__func__, sock, result,
iter->second.m_addr.created(), addr->created() );
}
}