sys/xtimer/xtimer.c: _mutex_timeout() cleanup#11807
Merged
jcarrano merged 4 commits intoRIOT-OS:masterfrom Aug 9, 2019
Merged
Conversation
removing line because core_thread_flags is not required
6 tasks
Contributor
Author
|
@vincent-d #11543 (comment) Could you look at this pr? It prepares for the change talked about in #11543 |
jcarrano
approved these changes
Aug 9, 2019
Contributor
jcarrano
left a comment
There was a problem hiding this comment.
I think this is OK. Squash.
Contributor
|
I mean, squash the comment only. |
if xtimer_set spins the callback is executed in the thread context. comment to explain irq_disable and when this line could be removed (when xtimer stops executing the callback funtion from thread context)
Only yields and change threads status when thread was removed from mutex list.
because of pr RIOT-OS#11759: not all boards check for is_in_irq when thread_yield_higher
e08fa67 to
c1f5818
Compare
Contributor
Author
|
Ok. Done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
This pr prepares for bug fixes and improvements of
xtimer.c:xtimer_mutex_lock_timeout()(the tracking pr: #11660 )This pr improves the _mutex_timeout() function.
It uses now
sched_switchinstead ofthread_yield_higher. (#11660 (comment), #11759)Only call
sched_switch(thread_yield_higherbefore) when the thread was unlocked.And ensure interrupt are disabled because it modifies a mutex. (if
xtimer_setspins the callback is executed in the thread context.)This pr also changes the comment of
sys/include/xtimer.h: xtimer_mutex_lock_timeout()Testing procedure
BOARD=native make -C tests/xtimer_mutex_lock timeout/ flash testoutput:
Issues/PRs references
the tracking pr: #11660
reason for sched_switch instead of thread_yield_higher: #11759, #11660 (comment)