Don't use pthread at all if no curl

This commit is contained in:
Lucas Baudin 2016-02-25 16:49:33 +01:00
parent 22b8d15939
commit 81f759e876

View File

@ -104,6 +104,7 @@ namespace Online
*/ */
void RequestManager::startNetworkThread() void RequestManager::startNetworkThread()
{ {
#ifndef NO_CURL
pthread_attr_t attr; pthread_attr_t attr;
pthread_attr_init(&attr); pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
@ -134,6 +135,7 @@ namespace Online
{ {
PlayerManager::resumeSavedSession(); PlayerManager::resumeSavedSession();
} }
#endif
} // startNetworkThread } // startNetworkThread
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -144,6 +146,7 @@ namespace Online
*/ */
void RequestManager::stopNetworkThread() void RequestManager::stopNetworkThread()
{ {
#ifndef NO_CURL
// This will queue a sign-out or client-quit request // This will queue a sign-out or client-quit request
PlayerManager::onSTKQuit(); PlayerManager::onSTKQuit();
@ -163,6 +166,7 @@ namespace Online
// be executed (before the quit request is executed, which causes this // be executed (before the quit request is executed, which causes this
// thread to exit). // thread to exit).
m_abort.setAtomic(true); m_abort.setAtomic(true);
#endif
} // stopNetworkThread } // stopNetworkThread
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -190,6 +194,7 @@ namespace Online
*/ */
void *RequestManager::mainLoop(void *obj) void *RequestManager::mainLoop(void *obj)
{ {
#ifndef NO_CURL
VS::setThreadName("RequestManager"); VS::setThreadName("RequestManager");
RequestManager *me = (RequestManager*) obj; RequestManager *me = (RequestManager*) obj;
@ -246,6 +251,7 @@ namespace Online
pthread_exit(NULL); pthread_exit(NULL);
return 0; return 0;
#endif
} // mainLoop } // mainLoop
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------