Docker: Fix threading

Make sure that the container state is synchronized
with the main thread.

Change-Id: I8b50a380779038b273a1eb6645aa08309e90bc56
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-10-04 09:50:53 +02:00
parent 759535be1a
commit c999f4f880

View File

@@ -888,6 +888,15 @@ expected_str<void> DockerDevicePrivate::startContainer()
bool DockerDevicePrivate::updateContainerAccess()
{
if (QThread::currentThread() != thread()) {
bool result = false;
QMetaObject::invokeMethod(this,
&DockerDevicePrivate::updateContainerAccess,
Qt::BlockingQueuedConnection,
&result);
return result;
}
if (m_isShutdown)
return false;