From 8066b05478ac646d0410fc9cedca5f82163b53d3 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 8 Oct 2024 12:59:30 +0900 Subject: [PATCH] Remove use of glib thread code. Use pthread instead Signed-off-by: Michele Calgaro --- src/kernel/tqthread_unix.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/src/kernel/tqthread_unix.cpp b/src/kernel/tqthread_unix.cpp index 00c389d2..db780ee1 100644 --- a/src/kernel/tqthread_unix.cpp +++ b/src/kernel/tqthread_unix.cpp @@ -52,10 +52,6 @@ typedef pthread_mutex_t Q_MUTEX_T; #include #include -#if defined(QT_USE_GLIBMAINLOOP) -#include -#endif // QT_USE_GLIBMAINLOOP - static TQMutexPool *qt_thread_mutexpool = 0; #if defined(Q_C_CALLBACKS) @@ -126,12 +122,6 @@ void *TQThreadInstance::start( void *_arg ) { void **arg = (void **) _arg; -#if defined(QT_USE_GLIBMAINLOOP) - // This is the first time we have access to the native pthread ID of this newly created thread - ((TQThreadInstance*)arg[1])->thread_id = pthread_self(); - pthread_detach(pthread_self()); -#endif // QT_USE_GLIBMAINLOOP - #ifdef QT_DEBUG tqDebug("TQThreadInstance::start: Setting thread storage to %p\n", (TQThread *) arg[0]); #endif // QT_DEBUG @@ -417,26 +407,6 @@ void TQThread::start(Priority priority) d->args[0] = this; d->args[1] = d; -#if defined(QT_USE_GLIBMAINLOOP) - // The correct thread_id is set in TQThreadInstance::start using the value of d->args[1] - d->thread_id = 0; - - // glib versions < 2.32.0 requires threading system initialization call - #if GLIB_CHECK_VERSION(2, 32, 0) - GThread* glib_thread_handle = g_thread_new( NULL, (GThreadFunc)TQThreadInstance::start, d->args ); - #else - if( !g_thread_get_initialized() ); - g_thread_init(NULL); - GThread* glib_thread_handle = g_thread_create((GThreadFunc)TQThreadInstance::start, d->args, false, NULL); - #endif - - if (glib_thread_handle) { - ret = 0; - } - else { - ret = -1; - } -#else // QT_USE_GLIBMAINLOOP ret = pthread_create( &d->thread_id, &attr, (TQtThreadCallback)TQThreadInstance::start, d->args ); #if defined (Q_OS_HPUX) if (ret == EPERM) { @@ -445,7 +415,6 @@ void TQThread::start(Priority priority) } #endif pthread_attr_destroy( &attr ); -#endif // QT_USE_GLIBMAINLOOP if ( ret ) { #ifdef QT_CHECK_STATE