OSDN Git Service

pthread_attr_setstacksize() is standardized by POSIX.1-2001, do not check for it
authorIvailo Monev <xakepa10@gmail.com>
Wed, 20 Jan 2021 22:56:58 +0000 (00:56 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 20 Jan 2021 22:56:58 +0000 (00:56 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
CMakeLists.txt
src/core/thread/qthread_unix.cpp

index cca7863..7e31ed0 100644 (file)
@@ -376,7 +376,6 @@ katie_check_struct(dirent d_type "dirent.h")
 
 cmake_reset_check_state()
 set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
-katie_check_function(pthread_attr_setstacksize "pthread.h")
 katie_check_function(pthread_setname_np "pthread.h")
 cmake_reset_check_state()
 
index 11542f0..75effe5 100644 (file)
@@ -338,12 +338,7 @@ void QThread::start(Priority priority)
     pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 
     if (d->stackSize > 0) {
-#if defined(QT_HAVE_PTHREAD_ATTR_SETSTACKSIZE)
         int code = pthread_attr_setstacksize(&attr, d->stackSize);
-#else
-        int code = ENOSYS; // stack size not supported, automatically fail
-#endif // _POSIX_THREAD_ATTR_STACKSIZE
-
         if (Q_UNLIKELY(code)) {
             qWarning("QThread::start: Thread stack size error: %s",
                      qPrintable(qt_error_string(code)));