QML: remove pthread_attr_init() from stackPropertiesGeneric()

The docs for pthread_getattr_np() say:

"The pthread_getattr_np() function initializes the thread attributes
object referred to by attr"

The comment in the glibc pthreads.h implementation even says:
/* Initialize thread attribute *ATTR with attributes corresponding to the
   already running thread TH.  It shall be called on uninitialized ATTR
   and destroyed with pthread_attr_destroy when no longer needed.  */

Pick-to: 6.5 6.6
Change-Id: I964c2b1e6b834feb9710fffd177c32dbb898fa3c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Thiago Macieira 2023-08-17 07:44:39 -07:00
parent 487bd23ee8
commit 9f4aeeabb9
1 changed files with 0 additions and 1 deletions

View File

@ -234,7 +234,6 @@ StackProperties stackPropertiesGeneric(qsizetype stackSize = 0)
pthread_t thread = pthread_self();
pthread_attr_t sattr;
pthread_attr_init(&sattr);
# if defined(PTHREAD_NP_H) || defined(_PTHREAD_NP_H_) || defined(Q_OS_NETBSD)
pthread_attr_get_np(thread, &sattr);
# else