winrt: Use SwitchToThread instead of Sleep(0)

UWP also supports SwitchToThread. The usage of Sleep(0) was a leftover
that was forgotten when porting to desktop Window's approach of handling
threads.

Change-Id: I5e3d6fb3eefe07407b910cc6a6b45781d320e151
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Oliver Wolff 2018-10-25 13:21:44 +02:00
parent eb056ee233
commit aa0e3d02d5

View File

@ -465,11 +465,7 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
void QThread::yieldCurrentThread()
{
#if !defined(Q_OS_WINRT)
SwitchToThread();
#else
::Sleep(0);
#endif
}
#endif // QT_CONFIG(thread)