[riot-notifications] [RIOT-OS/RIOT] core/mutex: Add mutex_cancel (#15442)

Marian Buschsieweke notifications at github.com
Thu Nov 26 21:47:56 CET 2020


@maribu commented on this pull request.



> @@ -148,3 +181,33 @@ void mutex_unlock_and_sleep(mutex_t *mutex)
     irq_restore(irqstate);
     thread_yield_higher();
 }
+
+void mutex_cancel(mutex_cancel_t *mc)
+{
+    unsigned irq_state = irq_disable();
+    mc->cancelled = 1;
+
+    mutex_t *mutex = mc->mutex;
+    thread_t *thread = mc->thread;
+    if (thread->status >= STATUS_ON_RUNQUEUE) {

Done and also squashed right in

-- 
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/15442#discussion_r531219687
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201126/c0b629ee/attachment.htm>


More information about the notifications mailing list