wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src network_worker.cpp


From: David White
Subject: [Wesnoth-cvs-commits] wesnoth/src network_worker.cpp
Date: Fri, 29 Oct 2004 18:09:20 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     David White <address@hidden>    04/10/29 22:03:46

Modified files:
        src            : network_worker.cpp 

Log message:
        fixed threading bugs

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/network_worker.cpp.diff?tr1=1.9&tr2=1.10&r1=text&r2=text

Patches:
Index: wesnoth/src/network_worker.cpp
diff -u wesnoth/src/network_worker.cpp:1.9 wesnoth/src/network_worker.cpp:1.10
--- wesnoth/src/network_worker.cpp:1.9  Fri Oct 29 22:01:23 2004
+++ wesnoth/src/network_worker.cpp      Fri Oct 29 22:03:46 2004
@@ -180,22 +180,23 @@
                const threading::lock lock(*global_mutex);
 
                const socket_state_map::iterator lock_it = 
sockets_locked.find(sock);
-               if(lock_it != sockets_locked.end() && lock_it->second == 
SOCKET_LOCKED) {
-                       continue;
-               } else if(lock_it != sockets_locked.end()) {
-                       sockets_locked.erase(lock_it);
-               }
+               
+               if(lock_it == sockets_locked.end() || lock_it->second != 
SOCKET_LOCKED) {
+                       if(lock_it != sockets_locked.end()) {
+                               sockets_locked.erase(lock_it);
+                       }
 
-               std::multiset<buffer>::iterator i = bufs.begin();
-               while(i != bufs.end()) {
-                       if(i->sock == sock) {
-                               bufs.erase(i++);
-                       } else {
-                               ++i;
+                       std::multiset<buffer>::iterator i = bufs.begin();
+                       while(i != bufs.end()) {
+                               if(i->sock == sock) {
+                                       bufs.erase(i++);
+                               } else {
+                                       ++i;
+                               }
                        }
-               }
 
-               return;
+                       break;
+               }
        }
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]