Abstract definition of rt-scheduler policy
[ardour.git] / libs / pbd / pbd / pthread_utils.h
index 2ef442caa5103bd4207ef4a082d46d1d2c148171..a1660eb073d4ef9b6a518e9d6ab6cc2d1f01f4d9 100644 (file)
@@ -67,4 +67,17 @@ namespace PBD {
        LIBPBD_API extern PBD::Signal3<void,pthread_t,std::string,uint32_t> ThreadCreatedWithRequestSize;
 }
 
+/* pthread-w32 does not support realtime scheduling
+ * (well, windows, doesn't..) and only supports SetThreadPriority()
+ *
+ * pthread_setschedparam() returns ENOTSUP if the policy is not SCHED_OTHER.
+ *
+ * however, pthread_create() with attributes, ignores the policy and
+ * only sets the priority (when PTHREAD_EXPLICIT_SCHED is used).
+ */
+#ifdef PLATFORM_WINDOWS
+#define PBD_SCHED_FIFO SCHED_OTHER
+#else
+#define PBD_SCHED_FIFO SCHED_FIFO
+#endif
 #endif /* __pbd_pthread_utils__ */