QThread/Unix: don't hardcode OSes for PThread cancellation support
Instead, check the macro that we're about to use. This is also done in qprocess_unix.cpp Pick-to: 6.5 6.6 Change-Id: I8f3ce163ccc5408cac39fffd178d657b7594d07a Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
9e26f1da0b
commit
dec72d165b
@ -277,7 +277,7 @@ void terminate_on_exception(T &&t)
|
|||||||
|
|
||||||
void *QThreadPrivate::start(void *arg)
|
void *QThreadPrivate::start(void *arg)
|
||||||
{
|
{
|
||||||
#if !defined(Q_OS_ANDROID)
|
#ifdef PTHREAD_CANCEL_DISABLE
|
||||||
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, nullptr);
|
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, nullptr);
|
||||||
#endif
|
#endif
|
||||||
pthread_cleanup_push(QThreadPrivate::finish, arg);
|
pthread_cleanup_push(QThreadPrivate::finish, arg);
|
||||||
@ -319,7 +319,7 @@ void *QThreadPrivate::start(void *arg)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
emit thr->started(QThread::QPrivateSignal());
|
emit thr->started(QThread::QPrivateSignal());
|
||||||
#if !defined(Q_OS_ANDROID)
|
#ifdef PTHREAD_CANCEL_DISABLE
|
||||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, nullptr);
|
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, nullptr);
|
||||||
pthread_testcancel();
|
pthread_testcancel();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user