[riot-notifications] [RIOT-OS/RIOT] sys/sema_inv: add inverse Semaphore (#15762)

Marian Buschsieweke notifications at github.com
Thu Jan 14 09:02:13 CET 2021


@maribu commented on this pull request.



> +    atomic_fetch_and_u32(&s->value, ~mask);
+
+    if (s->value == 0) {

This could result in multiple threads calling `mutex_unlock()`. This is not a problem with the current implementation, but maybe it is better to not rely on this.

```suggestion
    if (atomic_fetch_and_u32(&s->value, ~mask) == mask) {
```

-- 
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/15762#pullrequestreview-567990032
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210114/720a9f28/attachment-0001.htm>


More information about the notifications mailing list