From f3f5a316ca62e9d17776d4a49aab728aee65a5b5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 24 Aug 2013 21:44:43 +0300 Subject: move threads creation into sdl helper. --- src/net/download.cpp | 9 +++------ src/net/ea/network.cpp | 7 ++----- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'src/net') diff --git a/src/net/download.cpp b/src/net/download.cpp index 1d49caea2..4d03ea783 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -26,6 +26,8 @@ #include "logger.h" #include "main.h" +#include "utils/sdlhelper.h" + #include #include @@ -169,12 +171,7 @@ bool Download::start() { logger->log("Starting download: %s", mUrl.c_str()); -#ifdef USE_SDL2 - mThread = SDL_CreateThread(downloadThread, "download", this); -#else - mThread = SDL_CreateThread(downloadThread, this); -#endif - + mThread = SDL::createThread(downloadThread, "download", this); if (!mThread) { logger->log1(DOWNLOAD_ERROR_MESSAGE_THREAD); diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp index 3bcda3db3..92cbb14f8 100644 --- a/src/net/ea/network.cpp +++ b/src/net/ea/network.cpp @@ -30,6 +30,7 @@ #include "net/eathena/protocol.h" #include "utils/gettext.h" +#include "utils/sdlhelper.h" #include #include @@ -114,11 +115,7 @@ bool Network::connect(ServerInfo server) mToSkip = 0; mState = CONNECTING; -#ifdef USE_SDL2 - mWorkerThread = SDL_CreateThread(networkThread, "network", this); -#else - mWorkerThread = SDL_CreateThread(networkThread, this); -#endif + mWorkerThread = SDL::createThread(networkThread, "network", this); if (!mWorkerThread) { setError("Unable to create network worker thread"); -- cgit v1.2.3-70-g09d2