mail[Wesnoth-commits] r24511 - /trunk/src/network_worker.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by dave on March 11, 2008 - 03:54:
Author: dave
Date: Tue Mar 11 03:54:38 2008
New Revision: 24511

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24511&view=rev
Log:
further improvements to decrease contention on the server

Modified:
    trunk/src/network_worker.cpp

Modified: trunk/src/network_worker.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/network_worker.cpp?rev=24511&r1=24510&r2=24511&view=diff
==============================================================================
--- trunk/src/network_worker.cpp (original)
+++ trunk/src/network_worker.cpp Tue Mar 11 03:54:38 2008
@@ -597,10 +597,11 @@
                const threading::lock lock(*management_mutex);
                pending_receives.push_back(sock);
 
-               
sockets_locked.insert(std::pair<TCPsocket,SOCKET_STATE>(sock,SOCKET_READY));
-       }
-
-       cond->notify_one();
+               socket_state_map::const_iterator i = 
sockets_locked.insert(std::pair<TCPsocket,SOCKET_STATE>(sock,SOCKET_READY)).first;
+               if(i->second == SOCKET_READY || i->second == SOCKET_ERRORED) {
+                       cond->notify_one();
+               }
+       }
 }
 
 TCPsocket get_received_data(TCPsocket sock, config& cfg)




Related Messages


Powered by MHonArc, Updated Tue Mar 11 06:20:50 2008