+static bool rt_priorities = false;
+static int rt_offset;
+
+void vlc_threads_setup (libvlc_int_t *p_libvlc)
+{
+ static vlc_mutex_t lock = VLC_STATIC_MUTEX;
+ static bool initialized = false;
+
+ vlc_mutex_lock (&lock);
+ /* Initializes real-time priorities before any thread is created,
+ * just once per process. */
+ if (!initialized)
+ {
+#ifndef __APPLE__
+ if (config_GetInt (p_libvlc, "rt-priority"))
+#endif
+ {
+ rt_offset = config_GetInt (p_libvlc, "rt-offset");
+ rt_priorities = true;
+ }
+ initialized = true;
+ }
+ vlc_mutex_unlock (&lock);
+}
+