windows: attempt high priority only when asked for it

This commit is contained in:
Andrew Kelley 2015-07-02 23:18:00 -07:00
parent f57f691068
commit 1738edeaf9

View file

@ -210,9 +210,11 @@ int soundio_os_thread_create(
soundio_os_thread_destroy(thread); soundio_os_thread_destroy(thread);
return SoundIoErrorSystemResources; return SoundIoErrorSystemResources;
} }
if (high_priority) {
if (!SetThreadPriority(thread->handle, THREAD_PRIORITY_TIME_CRITICAL)) { if (!SetThreadPriority(thread->handle, THREAD_PRIORITY_TIME_CRITICAL)) {
win32_panic("unable to set high priority thread: %s"); // TODO don't panic win32_panic("unable to set high priority thread: %s"); // TODO don't panic
} }
}
#else #else
int err; int err;
if ((err = pthread_attr_init(&thread->attr))) { if ((err = pthread_attr_init(&thread->attr))) {