CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: David White <[EMAIL PROTECTED]> 05/09/04 14:46:38
Modified files:
src : thread.cpp thread.hpp
Log message:
attempt to fix connection to server problem on OSX
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/thread.cpp.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/thread.hpp.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
Patches:
Index: wesnoth/src/thread.cpp
diff -u wesnoth/src/thread.cpp:1.12 wesnoth/src/thread.cpp:1.13
--- wesnoth/src/thread.cpp:1.12 Tue Aug 9 08:15:50 2005
+++ wesnoth/src/thread.cpp Sun Sep 4 14:46:36 2005
@@ -1,4 +1,4 @@
-/* $Id: thread.cpp,v 1.12 2005/08/09 08:15:50 j_daniel Exp $ */
+/* $Id: thread.cpp,v 1.13 2005/09/04 14:46:36 Sirp Exp $ */
/*
Copyright (C) 2003-5 by David White <[EMAIL PROTECTED]>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -133,7 +133,8 @@
if(SDL_CondSignal(cond_) < 0) {
ERR_G << "SDL_CondSignal: " << SDL_GetError() << "\n";
return false;
- }
+ }
+
return true;
}
@@ -147,7 +148,8 @@
}
bool async_operation::notify_finished()
-{
+{
+ finishedVar_ = true;
return finished_.notify_one();
}
@@ -168,7 +170,7 @@
bool completed = false;
while(wait.process() == waiter::WAIT) {
const condition::WAIT_TIMEOUT_RESULT res =
finished_.wait_timeout(get_mutex(),20);
- if(res == condition::WAIT_OK) {
+ if(res == condition::WAIT_OK || finishedVar_) {
completed = true;
break;
} else if(res == condition::WAIT_ERROR) {
Index: wesnoth/src/thread.hpp
diff -u wesnoth/src/thread.hpp:1.7 wesnoth/src/thread.hpp:1.8
--- wesnoth/src/thread.hpp:1.7 Mon Aug 8 12:48:51 2005
+++ wesnoth/src/thread.hpp Sun Sep 4 14:46:37 2005
@@ -1,4 +1,4 @@
-/* $Id: thread.hpp,v 1.7 2005/08/08 12:48:51 j_daniel Exp $ */
+/* $Id: thread.hpp,v 1.8 2005/09/04 14:46:37 Sirp Exp $ */
/*
Copyright (C) 2003-5 by David White <[EMAIL PROTECTED]>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -201,7 +201,7 @@
enum RESULT { COMPLETED, ABORTED };
- async_operation() : aborted_(false) {}
+ async_operation() : aborted_(false), finishedVar_(false) {}
virtual ~async_operation() {}
RESULT execute(waiter& wait);
@@ -221,7 +221,8 @@
private:
bool aborted_;
- condition finished_;
+ condition finished_;
+ bool finishedVar_;
mutex mutex_;
};