[riot-notifications] [RIOT-OS/RIOT] core/mutex: Cleanup (#15327)

benpicco notifications at github.com
Fri Nov 6 14:31:28 CET 2020


@benpicco commented on this pull request.



> -            mutex->queue.next->next = NULL;
-        }
-        else {
-            thread_add_to_list(&mutex->queue, me);
-        }
-        irq_restore(irqstate);
-        thread_yield_higher();
-        /* We were woken up by scheduler. Waker removed us from queue.
-         * We have the mutex now. */
-        return 1;
+
+    thread_t *me = thread_get_active();
+    DEBUG("PID[%" PRIkernel_pid "]: Adding node to mutex queue: prio: %"
+          PRIu32 "\n", thread_getpid(), (uint32_t)me->priority);
+    sched_set_status(me, STATUS_MUTEX_BLOCKED);
+    if (mutex->queue.next == MUTEX_LOCKED) {

ping :wink: 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15327#discussion_r518751933
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201106/33861a73/attachment-0001.htm>


More information about the notifications mailing list