mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
don't bother pushing do-we-ack decision out of static method
This commit is contained in:
parent
498498a2bf
commit
481e50aaae
2 changed files with 13 additions and 12 deletions
|
@ -26,7 +26,13 @@ UDPAckTrack* UDPAckTrack::s_self = NULL;
|
|||
/* static*/ uint32_t
|
||||
UDPAckTrack::nextPacketID( XWRelayReg cmd )
|
||||
{
|
||||
return get()->nextPacketIDImpl( cmd );
|
||||
uint32_t result;
|
||||
if ( XWPDEV_ACK == cmd || XWPDEV_ALERT == cmd ) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = get()->nextPacketIDImpl();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* static*/ void
|
||||
|
@ -55,17 +61,12 @@ UDPAckTrack::UDPAckTrack()
|
|||
}
|
||||
|
||||
uint32_t
|
||||
UDPAckTrack::nextPacketIDImpl( XWRelayReg cmd )
|
||||
UDPAckTrack::nextPacketIDImpl()
|
||||
{
|
||||
uint32_t result;
|
||||
if ( XWPDEV_ACK == cmd || XWPDEV_ALERT == cmd ) {
|
||||
result = 0;
|
||||
} else {
|
||||
MutexLock ml( &m_mutex );
|
||||
AckRecord record;
|
||||
result = ++m_nextID;
|
||||
m_pendings.insert( pair<uint32_t,AckRecord>(result, record) );
|
||||
}
|
||||
MutexLock ml( &m_mutex );
|
||||
AckRecord record;
|
||||
uint32_t result = ++m_nextID;
|
||||
m_pendings.insert( pair<uint32_t,AckRecord>(result, record) );
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class UDPAckTrack {
|
|||
static UDPAckTrack* get();
|
||||
static void* thread_main( void* arg );
|
||||
UDPAckTrack();
|
||||
uint32_t nextPacketIDImpl( XWRelayReg cmd );
|
||||
uint32_t nextPacketIDImpl();
|
||||
void recordAckImpl( uint32_t packetID );
|
||||
void* threadProc();
|
||||
|
||||
|
|
Loading…
Reference in a new issue