posix_semaphore: make API POSIX compliant and port to xtimer (+ fixes)#4110
posix_semaphore: make API POSIX compliant and port to xtimer (+ fixes)#4110miri64 merged 9 commits intoRIOT-OS:masterfrom
Conversation
There was a problem hiding this comment.
I guess I typed in :x a little bit hasty here and forgot the : ;-)
|
While you're updating the POSIX semaphores, could you change the |
|
Done |
|
Quedtion: should we set errno to ENOMEM on sem_open, EINVAL on sem_close, ENOENT on sem_unlink? |
|
Yes and done. |
|
missing edit: |
|
Done. As a bonus I ported both sema and posix_semaphore to xtimer ;-) |
a2c4ebc to
636f684
Compare
|
Wait… something went wrong. The tests aren't working anymore -.- |
|
Bug seems to exist in master too. Will investigate. |
636f684 to
22c1486
Compare
|
According to the debugger TEST4 fails on msg_receive with a SIGALARM on native and on other boards the timer just never fires. in the other tests (timeout == 0) it works just fine. Ideas? |
|
Herpderp, if you change an API you might want to change the tests testing that API, too. Now everything should be in order :-) |
|
ACK, please squash I'm getting runtime failure of TEST4 |
|
I also see that native closes with |
8f8c0e5 to
7ba8473
Compare
|
Squashed |
Maybe I should put the |
|
@authmillenon https://travis-ci.org/RIOT-OS/RIOT/jobs/87419969 Travis fails on msp430.. |
|
#4182 should fix that. |
7ba8473 to
378727a
Compare
|
Based PR on that PR. |
Of course it does. And yes: in that case it exits early with return value equal to 0. |
|
@authmillenon do you agree that the xtimer should move outside the message waiting loop? (#4110 (comment)) |
|
There is still the issue of the timeout not being obeyed if the semaphore is posted and signalled to this thread, but another, higher priority, thread manages to snatch it before this thread has a chance to take it. Then the timeout in this thread will be reset to its original value again before waiting for another signal message. If this repeats we may overrun the timeout indefinitely. If the xtimer is moved to outside of the main waiting loop the timeout will be total waiting time instead of incremental per iteration. |
|
I'm only to 95% sure I got what you were saying so please check 8c49e19 =). |
|
Ping? |
|
yes, that was what I meant. |
|
Fixed. This is a lot of discussion for an standardized API change ;-P |
sys/sema/sema.c
Outdated
|
https://github.com/RIOT-OS/RIOT/pull/4110/files#diff-4af11e61eb26bcdd3eed69b819563f52R109 |
|
@authmillenon The reason for this long discussion is mostly because the original semaphore module (before your refactoring in the previous PR) had some bit rot that we are addressing here as well. |
True, but that could have been done in a follow-up ;-)
Addressed |
|
ACK, please squash |
1722501 to
c1effdc
Compare
|
Squashed |
|
Travis fails: |
c1effdc to
db01af3
Compare
|
Some commits got lost on rebase. Cherry-picked 'em back into place. |
posix_semaphore: make API POSIX compliant and port to xtimer (+ fixes)
|
Thanks for the review btw ^^" |
|
np, sorry for the long-winded review process. |
Fixes #4109 by renaming
semtosemaand fix its usage byposix_semaphoreaccordingly.