From 1738edeaf9fd8c55b708b6525b9d112383efa348 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 2 Jul 2015 23:18:00 -0700 Subject: [PATCH] windows: attempt high priority only when asked for it --- src/os.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/os.cpp b/src/os.cpp index f3bba82..5b60631 100644 --- a/src/os.cpp +++ b/src/os.cpp @@ -210,8 +210,10 @@ int soundio_os_thread_create( soundio_os_thread_destroy(thread); return SoundIoErrorSystemResources; } - if (!SetThreadPriority(thread->handle, THREAD_PRIORITY_TIME_CRITICAL)) { - win32_panic("unable to set high priority thread: %s"); // TODO don't panic + if (high_priority) { + if (!SetThreadPriority(thread->handle, THREAD_PRIORITY_TIME_CRITICAL)) { + win32_panic("unable to set high priority thread: %s"); // TODO don't panic + } } #else int err;