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

benpicco notifications at github.com
Thu Nov 26 13:01:46 CET 2020


@benpicco 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) {

```suggestion
    if (thread_is_active(thread)) {
```

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


More information about the notifications mailing list