Qt/WASM seems to have no thread support

This commit is contained in:
Uwe Rathmann 2024-01-19 15:52:00 +01:00
parent 9f9fafe9ef
commit 02d76b199a
2 changed files with 8 additions and 0 deletions

View File

@ -204,14 +204,18 @@ void QskMetaFunction::invoke( QObject* object,
return; return;
} }
#if QT_CONFIG(thread)
QSemaphore semaphore; QSemaphore semaphore;
#endif
auto event = new QMetaCallEvent( auto event = new QMetaCallEvent(
m_functionCall, nullptr, 0, argv, &semaphore ); m_functionCall, nullptr, 0, argv, &semaphore );
QCoreApplication::postEvent( receiver, event ); QCoreApplication::postEvent( receiver, event );
#if QT_CONFIG(thread)
semaphore.acquire(); semaphore.acquire();
#endif
break; break;
} }

View File

@ -192,14 +192,18 @@ static void qskInvokeMetaCall(
return; return;
} }
#if QT_CONFIG(thread)
QSemaphore semaphore; QSemaphore semaphore;
#endif
auto event = new MetaCallEvent( call, metaObject, auto event = new MetaCallEvent( call, metaObject,
offset, index, args, &semaphore ); offset, index, args, &semaphore );
QCoreApplication::postEvent( receiver, event ); QCoreApplication::postEvent( receiver, event );
#if QT_CONFIG(thread)
semaphore.acquire(); semaphore.acquire();
#endif
break; break;
} }