diff --git a/src/thread_priority.cpp b/src/thread_priority.cpp index 05e36313..ac9596ce 100644 --- a/src/thread_priority.cpp +++ b/src/thread_priority.cpp @@ -28,7 +28,12 @@ #include "realtime_tools/thread_priority.hpp" +#ifdef _WIN32 +#include +#else #include +#endif + #include #include @@ -49,10 +54,15 @@ bool has_realtime_kernel() bool configure_sched_fifo(int priority) { +#ifdef _WIN32 + HANDLE thread = GetCurrentThread(); + return SetThreadPriority(thread, priority); +#else struct sched_param schedp; memset(&schedp, 0, sizeof(schedp)); schedp.sched_priority = priority; return !sched_setscheduler(0, SCHED_FIFO, &schedp); +#endif } bool is_capable(cap_value_t v)