summaryrefslogtreecommitdiff
path: root/firmware/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/kernel')
-rw-r--r--firmware/kernel/mutex.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/kernel/mutex.c b/firmware/kernel/mutex.c
index fc49cc6..876b704 100644
--- a/firmware/kernel/mutex.c
+++ b/firmware/kernel/mutex.c
@@ -103,6 +103,12 @@ void mutex_unlock(struct mutex *m)
}
const int oldlevel = disable_irq_save();
+ /* Tranfer of owning thread is handled in the wakeup protocol
+ * if priorities are enabled otherwise just set it from the
+ * queue head. */
+#ifndef HAVE_PRIORITY_SCHEDULING
+ m->blocker.thread = thread;
+#endif
unsigned int result = wakeup_thread(thread, WAKEUP_TRANSFER);
restore_irq(oldlevel);