Fixed windows compilation (where pthread_t is a struct, not a integer like type).

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8100 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-03-28 23:34:36 +00:00
parent ec8e808c8c
commit 86bcc57f41
2 changed files with 6 additions and 4 deletions

View File

@ -77,11 +77,13 @@ NetworkHttp::NetworkHttp() : m_news(std::vector<NewsMessage>()),
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
int error=pthread_create(&m_thread_id, &attr, &NetworkHttp::mainLoop, this);
m_thread_id = new pthread_t();
int error=pthread_create(m_thread_id, &attr, &NetworkHttp::mainLoop, this);
if(error)
{
delete m_thread_id;
m_thread_id = 0;
printf("[addons] Warning: could not create thread, error=%d.\n", errno);
printf("[addons] Warning: could not create thread, error=%d.\n", errno);
}
pthread_attr_destroy(&attr);
} // NetworkHttp
@ -205,7 +207,7 @@ NetworkHttp::~NetworkHttp()
if(m_thread_id)
{
void *result;
pthread_join(m_thread_id, &result);
pthread_join(*m_thread_id, &result);
if(UserConfigParams::m_verbosity>=3)
printf("[addons] Network thread joined.\n");
}

View File

@ -109,7 +109,7 @@ private:
Synchronised<bool> m_abort;
/** Thread id of the thread running in this object. */
pthread_t m_thread_id;
pthread_t *m_thread_id;
static void *mainLoop(void *obj);
void checkRedirect(const XMLNode *xml);