1
0

Improved threading performance by reducing thread-hopping in queue locks (cs unlocked before event set)

git-svn-id: http://mc-server.googlecode.com/svn/trunk@341 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-02-28 16:59:59 +00:00
parent a4503ddb77
commit 5d0da9a2c0
3 changed files with 41 additions and 29 deletions

View File

@@ -714,9 +714,11 @@ void cServer::cNotifyWriteThread::Execute(void)
void cServer::cNotifyWriteThread::NotifyClientWrite(const cClientHandle * a_Client)
{
cCSLock Lock(m_CS);
m_Clients.remove(const_cast<cClientHandle *>(a_Client)); // Put it there only once
m_Clients.push_back(const_cast<cClientHandle *>(a_Client));
{
cCSLock Lock(m_CS);
m_Clients.remove(const_cast<cClientHandle *>(a_Client)); // Put it there only once
m_Clients.push_back(const_cast<cClientHandle *>(a_Client));
}
m_Event.Set();
}