diff options
Diffstat (limited to 'src/network/core')
-rw-r--r-- | src/network/core/tcp.h | 3 | ||||
-rw-r--r-- | src/network/core/tcp_connect.cpp | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h index 243ec042d..f9e1e00cb 100644 --- a/src/network/core/tcp.h +++ b/src/network/core/tcp.h @@ -63,7 +63,6 @@ public: */ class TCPConnecter { private: - class ThreadObject *thread; ///< Thread used to create the TCP connection bool connected; ///< Whether we succeeded in making the connection bool aborted; ///< Whether we bailed out (i.e. connection making failed) bool killed; ///< Whether we got killed @@ -71,7 +70,7 @@ private: void Connect(); - static void ThreadEntry(void *param); + static void ThreadEntry(TCPConnecter *param); protected: /** Address we're connecting to */ diff --git a/src/network/core/tcp_connect.cpp b/src/network/core/tcp_connect.cpp index d76042821..d923688b1 100644 --- a/src/network/core/tcp_connect.cpp +++ b/src/network/core/tcp_connect.cpp @@ -12,7 +12,7 @@ */ #include "../../stdafx.h" -#include "../../thread/thread.h" +#include "../../thread.h" #include "tcp.h" @@ -33,7 +33,7 @@ TCPConnecter::TCPConnecter(const NetworkAddress &address) : address(address) { _tcp_connecters.push_back(this); - if (!ThreadObject::New(TCPConnecter::ThreadEntry, this, &this->thread, "ottd:tcp")) { + if (!StartNewThread(NULL, "ottd:tcp", &TCPConnecter::ThreadEntry, this)) { this->Connect(); } } @@ -53,9 +53,9 @@ void TCPConnecter::Connect() * Entry point for the new threads. * @param param the TCPConnecter instance to call Connect on. */ -/* static */ void TCPConnecter::ThreadEntry(void *param) +/* static */ void TCPConnecter::ThreadEntry(TCPConnecter *param) { - static_cast<TCPConnecter*>(param)->Connect(); + param->Connect(); } /** |