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

Marian Buschsieweke notifications at github.com
Wed Jan 13 20:54:03 CET 2021


@maribu commented on this pull request.

The implementation is very elegant and lean :-) Some comments inline

> +    mutex_init(&s->lock);
+    mutex_lock(&s->lock);

```suggestion
    const mutex_t locked = MUTEX_INIT_LOCKED;
    s->lock = locked;
```

> + * @return  `true` if the value of the semaphore
+ *          has reached zero and the waiting thread has been woken

```suggestion
 * @retval  `true`  the value of the semaphore has reached zero and the waiting thread has been woken
 * @retval  `false` the semaphore has not reached zero yet
```

> + * @return  `true` if the value of the semaphore
+ *          has reached zero and the waiting thread has been woken

```suggestion
 * @retval  `true`  the value of the semaphore has reached zero and the waiting thread has been woken
 * @retval  `false` the semaphore has not reached zero yet
```

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


More information about the notifications mailing list