From 5d0da9a2c04673eaceb630c7d38dddf4b80d2183 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 28 Feb 2012 16:59:59 +0000 Subject: 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 --- source/cServer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/cServer.cpp') diff --git a/source/cServer.cpp b/source/cServer.cpp index ab4698f3f..3b85a45c4 100644 --- a/source/cServer.cpp +++ b/source/cServer.cpp @@ -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(a_Client)); // Put it there only once - m_Clients.push_back(const_cast(a_Client)); + { + cCSLock Lock(m_CS); + m_Clients.remove(const_cast(a_Client)); // Put it there only once + m_Clients.push_back(const_cast(a_Client)); + } m_Event.Set(); } -- cgit v1.2.3