summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgregory guy <gregory-tde@laposte.net>2021-06-18 18:37:34 +0200
committerMichele Calgaro <michele.calgaro@yahoo.it>2021-06-21 10:36:25 +0900
commita29bd4d895020a43cc13354e591991e020134481 (patch)
tree04daaae713cf655a3f402287198e3f03ac32dff4
parentfed23c9f797d8a1082097e97dc0c1bc16c1b9ed3 (diff)
downloadtqt3-a29bd4d8.tar.gz
tqt3-a29bd4d8.zip
Remove deprecated glib2 function calls g_thread_get_initialized(), g_thread_init() and g_thread_create().
Signed-off-by: gregory guy <gregory-tde@laposte.net> (cherry picked from commit 43d7bc96c782afaf2e5047def508081b81815392)
-rw-r--r--src/kernel/qthread_unix.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/kernel/qthread_unix.cpp b/src/kernel/qthread_unix.cpp
index 7140d279..d0b32f6e 100644
--- a/src/kernel/qthread_unix.cpp
+++ b/src/kernel/qthread_unix.cpp
@@ -415,14 +415,15 @@ void TQThread::start(Priority priority)
// The correct thread_id is set in TQThreadInstance::start using the value of d->args[1]
d->thread_id = 0;
- // Legacy glib versions require this threading system initialization call
- if (!GLIB_CHECK_VERSION (2, 32, 0)) {
- if( ! g_thread_get_initialized () ) {
- g_thread_init(NULL);
- }
- }
+ // 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
- GThread* glib_thread_handle = g_thread_create((GThreadFunc)TQThreadInstance::start, d->args, false, NULL);
if (glib_thread_handle) {
ret = 0;
}