Remove pthread_setcancelstate functions.

This function is not available on android and it is default on other platforms anyway.
It makes easier to port changes from master to android branch.
This commit is contained in:
Deve 2016-11-11 14:11:27 +01:00
parent 6b2bf1c088
commit e707b7a2ea
4 changed files with 2 additions and 14 deletions

View File

@ -75,9 +75,6 @@ void NewsManager::init(bool force_refresh)
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
// Should be the default, but just in case:
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
//pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
pthread_t thread_id;
int error = pthread_create(&thread_id, &attr,
&NewsManager::downloadNews, this);

View File

@ -91,9 +91,6 @@ SFXManager::SFXManager()
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
// Should be the default, but just in case:
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
m_thread_id.setAtomic(new pthread_t());
// The thread is created even if there atm sfx are disabled
// (since the user might enable it later).
@ -299,8 +296,6 @@ void* SFXManager::mainLoop(void *obj)
VS::setThreadName("SFXManager");
SFXManager *me = (SFXManager*)obj;
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
me->m_sfx_commands.lock();
// Wait till we have an empty sfx in the queue

View File

@ -43,8 +43,10 @@ NetworkConsole::NetworkConsole()
// ----------------------------------------------------------------------------
NetworkConsole::~NetworkConsole()
{
#ifndef ANDROID
if (m_thread_keyboard)
pthread_cancel(*m_thread_keyboard);//, SIGKILL);
#endif
}
// ----------------------------------------------------------------------------

View File

@ -104,10 +104,6 @@ namespace Online
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
// Should be the default, but just in case:
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
//pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
m_thread_id.setAtomic(new pthread_t());
int error = pthread_create(m_thread_id.getData(), &attr,
&RequestManager::mainLoop, this);
@ -189,8 +185,6 @@ namespace Online
VS::setThreadName("RequestManager");
RequestManager *me = (RequestManager*) obj;
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
me->m_current_request = NULL;
me->m_request_queue.lock();
while (me->m_request_queue.getData().empty() ||