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

benpicco notifications at github.com
Thu Nov 19 00:28:34 CET 2020


@benpicco commented on this pull request.



> +              thread_getpid());
+        irq_restore(irq_state);
+    }
+    else {
+        _block(mutex, irq_state);
+    }
+}
+
+int mutex_lock_cancelable(mutex_cancel_t *mc)
+{
+    unsigned irq_state = irq_disable();
+
+    DEBUG("PID[%" PRIkernel_pid "]: mutex_lock_cancelable()\n",
+          thread_getpid());
+
+    if (mc->cancelled) {

Ok that makes sense. So `mutex_cancel_init()` marks the earliest time a mutex can be canceled (also for subsequent calls) 

-- 
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_r526489991
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201118/450b1f77/attachment-0001.htm>


More information about the notifications mailing list