(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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user