(svn r15159) -Fix: move the UDP queries that resolve a hostname into threads so they don't freeze OpenTTD when for example the network connection got severed. Thanks to glx for writing the mutex implementation for Windows.

This commit is contained in:
rubidium
2009-01-20 03:44:43 +00:00
parent 202aeb8306
commit 82e98c2188
7 changed files with 250 additions and 54 deletions

View File

@@ -10,3 +10,15 @@
if (thread != NULL) *thread = NULL;
return false;
}
/** Mutex that doesn't do locking because it ain't needed when there're no threads */
class ThreadMutex_None : ThreadMutex {
public:
virtual void BeginCritical() {}
virtual void EndCritical() {}
};
/* static */ ThreadMutex *ThreadMutex::New()
{
return new ThreadMutex_None;
}