summaryrefslogtreecommitdiffstats
path: root/qtools/qthread_unix.cpp
diff options
context:
space:
mode:
authorAli Abdulkadir <autostart.ini@gmail.com>2017-03-03 02:13:33 (GMT)
committerAli Abdulkadir <autostart.ini@gmail.com>2017-03-03 02:14:18 (GMT)
commit4e25f081847cf2717ad561214e90d9750da5a511 (patch)
treebe7641ece4bcac408bf73b652b5d21d63bdb221f /qtools/qthread_unix.cpp
parent82ed99b4050963ab1c7134dede952400ff75dffc (diff)
downloadDoxygen-4e25f081847cf2717ad561214e90d9750da5a511.zip
Doxygen-4e25f081847cf2717ad561214e90d9750da5a511.tar.gz
Doxygen-4e25f081847cf2717ad561214e90d9750da5a511.tar.bz2
Isolated none-existing posix threading functions on Android
Diffstat (limited to 'qtools/qthread_unix.cpp')
-rw-r--r--qtools/qthread_unix.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/qtools/qthread_unix.cpp b/qtools/qthread_unix.cpp
index b536583..5871605 100644
--- a/qtools/qthread_unix.cpp
+++ b/qtools/qthread_unix.cpp
@@ -76,14 +76,18 @@ QThreadPrivate::~QThreadPrivate()
void *QThreadPrivate::start(void *arg)
{
+#ifndef __ANDROID__
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
+#endif
pthread_cleanup_push(QThreadPrivate::finish, arg);
QThread *thr = reinterpret_cast<QThread *>(arg);
thr->started();
+#ifndef __ANDROID__
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_testcancel();
+#endif
thr->run();
pthread_cleanup_pop(1);
@@ -132,7 +136,9 @@ void QThread::start()
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
+#ifndef __ANDROID__
pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED);
+#endif
if (d->stackSize>0)
{
#if defined(_POSIX_THREAD_ATTR_STACKSIZE) && (_POSIX_THREAD_ATTR_STACKSIZE-0>0)
@@ -160,7 +166,7 @@ void QThread::start()
void QThread::terminate()
{
QMutexLocker locker(&d->mutex);
-
+#ifndef __ANDROID__
if (!d->thread_id) return;
int code = pthread_cancel(d->thread_id);
@@ -172,6 +178,7 @@ void QThread::terminate()
{
d->terminated = TRUE;
}
+#endif
}
void QThread::wait()