summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/download.cpp8
-rw-r--r--src/net/ea/network.cpp7
-rw-r--r--src/net/ipc.cpp4
3 files changed, 5 insertions, 14 deletions
diff --git a/src/net/download.cpp b/src/net/download.cpp
index 769a498b3..54aa8b217 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -110,9 +110,7 @@ Download::~Download()
mHeaders = nullptr;
}
- int status;
- if ((mThread != nullptr) && (SDL_GetThreadID(mThread) != 0u))
- SDL_WaitThread(mThread, &status);
+ SDL::WaitThread(mThread);
mThread = nullptr;
free(mError);
}
@@ -208,9 +206,7 @@ void Download::cancel()
logger->log("Canceling download: %s", mUrl.c_str());
mOptions.cancel = 1u;
- if ((mThread != nullptr) && (SDL_GetThreadID(mThread) != 0u))
- SDL_WaitThread(mThread, nullptr);
-
+ SDL::WaitThread(mThread);
mThread = nullptr;
}
diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp
index ad7909c7a..1ae4d2323 100644
--- a/src/net/ea/network.cpp
+++ b/src/net/ea/network.cpp
@@ -140,11 +140,8 @@ void Network::disconnect()
BLOCK_START("Network::disconnect")
mState = IDLE;
- if ((mWorkerThread != nullptr) && (SDL_GetThreadID(mWorkerThread) != 0u))
- {
- SDL_WaitThread(mWorkerThread, nullptr);
- mWorkerThread = nullptr;
- }
+ SDL::WaitThread(mWorkerThread);
+ mWorkerThread = nullptr;
if (mSocket != nullptr)
{
diff --git a/src/net/ipc.cpp b/src/net/ipc.cpp
index b3fd3da9d..407f8ca3b 100644
--- a/src/net/ipc.cpp
+++ b/src/net/ipc.cpp
@@ -57,9 +57,7 @@ IPC::~IPC()
}
SDL_DestroyMutex(mMutex);
mMutex = nullptr;
- int status;
- if ((mThread != nullptr) && (SDL_GetThreadID(mThread) != 0u))
- SDL_WaitThread(mThread, &status);
+ SDL::WaitThread(mThread);
mThread = nullptr;
}