New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
evtimer: add mbox support #14498
evtimer: add mbox support #14498
Conversation
32a5dcc
to
addd41f
Compare
child.expect('Test successful') | ||
print('Test successful') | ||
except Exception: | ||
print('Test failed') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ironically makes the test succeed (from the perspective of the CI), because there is no error exit case now. If you want output, just make the echo
parameter of the run()
function True
and remove the prints and exception handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the exception handling
e0c12d0
to
78e2a05
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a reason for evtimer_mbox
falling back to evtimer_msg
other than a slight usage advantage. However, implicit behavior often makes things more complicated and harder to test.
sys/include/evtimer_msg_mbox.h
Outdated
evtimer_msg_mbox_event_t *mbevent = (evtimer_msg_mbox_event_t *)event; | ||
|
||
/* If a message box is set, store message, otherwise | ||
* fallback to message handler of evtimer_msg */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? This makes things more complicated than they need to. If you want to send to a thread's message queue rather than an mbox
use evtimer_msg
and not use implicit behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll see your point there. Originally this PR was intended to be able to send messages to mboxes and normal messages from the same evtimer, reducing the nessecary changes in gnrc_tcp later on.
However rewriting this to only support mboxes is the better approach.
9c42e6a
to
e520c6a
Compare
All previous discussed issues are addressed now. Please review again. |
Can you please use fixup commits? With such big time differences between review and addressing I start to lose overview. |
I'll do next time. However with the changes, it was basically a rewrite of the PR contents so fixup would not have made that much sence. |
e520c6a
to
bc18ab6
Compare
@miri64 - Would you do me a favor and review this PR again? From my point of view it looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me, tests pass on samr21-xpro
and nrf52840-dongle
. Let's wait for Murdock, if it finds any issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coccinelle found some stuff. You might need to include kernel_defines.h
for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK! Please squash.
e326755
to
5d67dae
Compare
Done |
And go. Thanks for this contribution. Looking forward to merging #14500 :-) |
#14500 is already rebased ;) Thanks for your reviewing efforts |
Hi,
This PR adds evtimer_msg_mbox_event_t (extends evtimer_msg_event_t with mbox support) and related test code.
It can be tested by executing the contained test code.
With this PR, the xtimers in gnrc_tcp can be replaced with a single evtimer per TCB, as discussed in #14294.