void *QThreadPrivate::start(void *arg)
{
+#if !defined(Q_OS_LINUX_ANDROID)
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
+#endif
pthread_cleanup_push(QThreadPrivate::finish, arg);
QThread *thr = reinterpret_cast<QThread *>(arg);
#endif
emit thr->started();
+#if !defined(Q_OS_LINUX_ANDROID)
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_testcancel();
+#endif
thr->run();
pthread_cleanup_pop(1);
if (code == EPERM) {
// caller does not have permission to set the scheduling
// parameters/policy
+#if defined(QT_HAS_THREAD_PRIORITY_SCHEDULING)
pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED);
+#endif
code =
pthread_create(&d->thread_id, &attr, QThreadPrivate::start, this);
}
void QThread::terminate()
{
+#if !defined(Q_OS_LINUX_ANDROID)
Q_D(QThread);
QMutexLocker locker(&d->mutex);
} else {
d->terminated = true;
}
+#endif
}
bool QThread::wait(unsigned long time)
"Current thread was not started with QThread.");
Q_UNUSED(thr)
+#if defined(Q_OS_LINUX_ANDROID)
+ Q_UNUSED(enabled);
+#else
pthread_setcancelstate(enabled ? PTHREAD_CANCEL_ENABLE : PTHREAD_CANCEL_DISABLE, NULL);
if (enabled)
pthread_testcancel();
+#endif
}
void QThread::setPriority(Priority priority)