From 02d76b199a2dce8552248081080e40875dbc3f02 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Fri, 19 Jan 2024 15:52:00 +0100 Subject: [PATCH] Qt/WASM seems to have no thread support --- src/common/QskMetaFunction.cpp | 4 ++++ src/common/QskMetaInvokable.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/common/QskMetaFunction.cpp b/src/common/QskMetaFunction.cpp index 56d04080..9b3bea0d 100644 --- a/src/common/QskMetaFunction.cpp +++ b/src/common/QskMetaFunction.cpp @@ -204,14 +204,18 @@ void QskMetaFunction::invoke( QObject* object, return; } +#if QT_CONFIG(thread) QSemaphore semaphore; +#endif auto event = new QMetaCallEvent( m_functionCall, nullptr, 0, argv, &semaphore ); QCoreApplication::postEvent( receiver, event ); +#if QT_CONFIG(thread) semaphore.acquire(); +#endif break; } diff --git a/src/common/QskMetaInvokable.cpp b/src/common/QskMetaInvokable.cpp index 1f73633d..64c118f0 100644 --- a/src/common/QskMetaInvokable.cpp +++ b/src/common/QskMetaInvokable.cpp @@ -192,14 +192,18 @@ static void qskInvokeMetaCall( return; } +#if QT_CONFIG(thread) QSemaphore semaphore; +#endif auto event = new MetaCallEvent( call, metaObject, offset, index, args, &semaphore ); QCoreApplication::postEvent( receiver, event ); +#if QT_CONFIG(thread) semaphore.acquire(); +#endif break; }