diff options
author | sapier <Sapier at GMX dot net> | 2013-12-03 23:32:03 +0100 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2013-12-15 13:39:42 +0100 |
commit | e9e9fd7c3f12bc5119b567ad37527d777859dbc0 (patch) | |
tree | cc3eb08bf696444ae6bea4a0cfe2cf29f66b56be /src/httpfetch.cpp | |
parent | 977232261388fa80bd6ab3bb849ae4d7a8ade73e (diff) | |
download | hax-minetest-server-e9e9fd7c3f12bc5119b567ad37527d777859dbc0.tar.gz hax-minetest-server-e9e9fd7c3f12bc5119b567ad37527d777859dbc0.zip |
Replace SimpleThread by JThread now implementing same features
Diffstat (limited to 'src/httpfetch.cpp')
-rw-r--r-- | src/httpfetch.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/httpfetch.cpp b/src/httpfetch.cpp index 64e77bc54..12e203ef2 100644 --- a/src/httpfetch.cpp +++ b/src/httpfetch.cpp @@ -319,7 +319,7 @@ struct HTTPFetchOngoing } }; -class CurlFetchThread : public SimpleThread +class CurlFetchThread : public JThread { protected: enum RequestType { @@ -539,7 +539,6 @@ protected: void * Thread() { - ThreadStarted(); log_register_thread("CurlFetchThread"); DSTACK(__FUNCTION_NAME); @@ -553,7 +552,7 @@ protected: assert(m_all_ongoing.empty()); - while (getRun()) { + while (!StopRequested()) { BEGIN_DEBUG_EXCEPTION_HANDLER /* @@ -641,9 +640,9 @@ void httpfetch_cleanup() { verbosestream<<"httpfetch_cleanup: cleaning up"<<std::endl; - g_httpfetch_thread->setRun(false); + g_httpfetch_thread->Stop(); g_httpfetch_thread->requestWakeUp(); - g_httpfetch_thread->stop(); + g_httpfetch_thread->Wait(); delete g_httpfetch_thread; curl_global_cleanup(); @@ -652,8 +651,6 @@ void httpfetch_cleanup() void httpfetch_async(const HTTPFetchRequest &fetchrequest) { g_httpfetch_thread->requestFetch(fetchrequest); - if (!g_httpfetch_thread->IsRunning()) - g_httpfetch_thread->Start(); } static void httpfetch_request_clear(unsigned long caller) |