Avoid spurious error from wxThread::SetPriority() in wxMSW

Just skip calling ::SetThreadPriority() if the thread hadn't been
created yet: this was useless and just resulted in an error message.
This commit is contained in:
Vadim Zeitlin
2019-12-28 00:05:16 +01:00
parent 9689bd124e
commit 2c4f42608b

View File

@@ -606,6 +606,14 @@ void wxThreadInternal::SetPriority(unsigned int priority)
{
m_priority = priority;
if ( !m_hThread )
{
// The thread hasn't been created yet, so calling SetThreadPriority()
// right now would just result in an error -- just skip doing this, as
// the priority will be set when Create() is called later.
return;
}
// translate wxWidgets priority to the Windows one
int win_priority;
if (m_priority <= 20)