Work-around crash in QThreadPool QThread usage
This works around mismatch in threads starting and restarting QThreads, and is safe since we don't need to establish a binding, and objectName access in QThreadPool is locked behind a mutex. Pick-to: 6.3 6.2 Fixes: QTBUG-96718 Change-Id: Id3f75e4f8344796ca658899645219fe3373ddd6d Reviewed-by: Marc Mutz <marc.mutz@qt.io>bb10
parent
0f5a1725a0
commit
664c56d6b1
|
|
@ -735,7 +735,9 @@ void QThread::start(Priority priority)
|
|||
else
|
||||
pthread_attr_setthreadname(&attr, objectName().toLocal8Bit());
|
||||
#else
|
||||
d->objectName = objectName();
|
||||
// avoid interacting with the binding system
|
||||
d->objectName = d->extraData ? d->extraData->objectName.valueBypassingBindings()
|
||||
: QString();
|
||||
#endif
|
||||
|
||||
pthread_t threadId;
|
||||
|
|
|
|||
|
|
@ -420,7 +420,9 @@ void QThread::start(Priority priority)
|
|||
if (d->running)
|
||||
return;
|
||||
|
||||
d->objectName = objectName();
|
||||
// avoid interacting with the binding system
|
||||
d->objectName = d->extraData ? d->extraData->objectName.valueBypassingBindings()
|
||||
: QString();
|
||||
d->running = true;
|
||||
d->finished = false;
|
||||
d->exited = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue