From 0e33c919dd5c954e0e9d266924c1650237bb95a1 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 26 Feb 2012 00:36:51 +0000 Subject: Using cSocketThreads for client outgoing packets. Unfortunately had to put in one intermediate thread (cServer::cNotifyWriteThread) to avoid deadlocks. Still, seems we have a proper multithreading for clients and no more per-client threads, yay :) git-svn-id: http://mc-server.googlecode.com/svn/trunk@328 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cClientHandle.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'source/cClientHandle.h') diff --git a/source/cClientHandle.h b/source/cClientHandle.h index 6b567a88b..3fcfef716 100644 --- a/source/cClientHandle.h +++ b/source/cClientHandle.h @@ -98,8 +98,6 @@ public: void Send(const cPacket & a_Packet, ENUM_PRIORITY a_Priority = E_PRIORITY_NORMAL) { Send(&a_Packet, a_Priority); } void Send(const cPacket * a_Packet, ENUM_PRIORITY a_Priority = E_PRIORITY_NORMAL); - static void SendThread( void *lpParam ); - const AString & GetUsername(void) const; inline short GetPing() { return m_Ping; } @@ -118,20 +116,17 @@ private: AString m_ReceivedData; // Accumulator for the data received from the socket, waiting to be parsed; accessed from the cSocketThreads' thread only! - PacketList m_PendingNrmSendPackets; - PacketList m_PendingLowSendPackets; + cCriticalSection m_CSPackets; + PacketList m_PendingNrmSendPackets; + PacketList m_PendingLowSendPackets; cCriticalSection m_CSChunkLists; cChunkCoordsList m_LoadedChunks; // Chunks that the player belongs to cChunkCoordsList m_ChunksToSend; // Chunks that need to be sent to the player (queued because they weren't generated yet or there's not enough time to send them) - cThread * m_pSendThread; - cSocket m_Socket; cCriticalSection m_CriticalSection; - cCriticalSection m_SendCriticalSection; - cSemaphore m_Semaphore; Vector3d m_ConfirmPosition; -- cgit v1.2.3