+#if CONFIG_KERN_PRI_INHERIT
+ int new_pri;
+
+ /*
+ * Whatever it will happen below, this is the new
+ * original priority of the process, i.e., the priority
+ * it has without taking inheritance under account.
+ */
+ proc->orig_pri = pri;
+
+ /* If not changing anything we can just leave */
+ if ((new_pri = __prio_proc(proc)) == proc->link.pri)
+ return;
+
+ /*
+ * Actual process priority is the highest among its
+ * own priority and the one of the top-priority
+ * process that it is blocking (returned by
+ * __prio_proc()).
+ */
+ proc->link.pri = new_pri;
+#else