>> Не вижу связи с Qt под Win32 API. Заявлена поддержка MSVC.
> Очень плохо, что вы связи не видите.
> Обычно MinGW собирается только с включенным --enable-threads=posix, --enable-threads=win32 Программисты для Windows обычно используют MSVC.
> не включают. В makefile она по умолчанию в disable. Поддержку threads=win32,
> а так же Win32API осуществляет либа w32api. Данная либа до сих
> пор собирается под Windows7.
В Win32 API потоки создаются функцией CreateTread().
Qt именно её и использует.
Странно, что исходники Qt приходится смотреть мне, а не специалисту по её сборке.
/*
NOTE: we create the thread in the suspended state, set the
priority and then resume the thread. since threads are created with normal priority by default, we
could get into a case where a thread (with priority less than
NormalPriority) tries to create a new thread (also with priority
less than NormalPriority), but the newly created thread preempts
its 'parent' and runs at normal priority.
*/
#if defined(Q_CC_MSVC) && !defined(_DLL) // && !defined(Q_OS_WINRT)
# ifdef Q_OS_WINRT
// If you wish to accept the memory leaks, uncomment the part above.
// See:
// https://support.microsoft.com/en-us/kb/104641
// https://msdn.microsoft.com/en-us/library/kdzttdcb.aspx
# error "Microsoft documentation says this combination leaks memory every time a thread is started. " \
"Please change your build back to -MD/-MDd or, if you understand this issue and want to continue, " \
"edit this source file."
# endif
// MSVC -MT or -MTd build
d->handle = (Qt::HANDLE) _beginthreadex(NULL, d->stackSize, QThreadPrivate::start,
this, CREATE_SUSPENDED, &(d->id));
#else
// MSVC -MD or -MDd or MinGW build
d->handle = CreateThread(nullptr, d->stackSize,
reinterpret_cast<LPTHREAD_START_ROUTINE>(QThreadPrivate::start),
this, CREATE_SUSPENDED, reinterpret_cast<LPDWORD>(&d->id));
#endif // Q_OS_WINRT