-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sys/xtimer/xtimer.c: _mutex_timeout() cleanup #11807
Merged
jcarrano
merged 4 commits into
RIOT-OS:master
from
JulianHolzwarth:pr/xtimer_mutex_lock_timeout/first_fix_improvements
Aug 9, 2019
Merged
sys/xtimer/xtimer.c: _mutex_timeout() cleanup #11807
jcarrano
merged 4 commits into
RIOT-OS:master
from
JulianHolzwarth:pr/xtimer_mutex_lock_timeout/first_fix_improvements
Aug 9, 2019
Conversation
This file contains 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
removing line because core_thread_flags is not required
6 tasks
JulianHolzwarth
changed the title
sys/xtimer/xtimer.c: _mutex_timeout() clean ups
sys/xtimer/xtimer.c: _mutex_timeout() cleanup
Jul 10, 2019
@vincent-d #11543 (comment) Could you look at this pr? It prepares for the change talked about in #11543 |
MrKevinWeiss
added
Type: cleanup
The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Area: timers
Area: timer subsystems
labels
Jul 18, 2019
jcarrano
approved these changes
Aug 9, 2019
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 think this is OK. Squash.
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
JulianHolzwarth
force-pushed
the
pr/xtimer_mutex_lock_timeout/first_fix_improvements
branch
from
August 9, 2019 15:31
e08fa67
to
c1f5818
Compare
Ok. Done. |
jcarrano
added
the
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
label
Aug 9, 2019
JulianHolzwarth
deleted the
pr/xtimer_mutex_lock_timeout/first_fix_improvements
branch
August 9, 2019 17:39
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: timers
Area: timer subsystems
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Type: cleanup
The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
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_switch
instead ofthread_yield_higher
. (#11660 (comment), #11759)Only call
sched_switch
(thread_yield_higher
before) when the thread was unlocked.And ensure interrupt are disabled because it modifies a mutex. (if
xtimer_set
spins 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 test
output:
Issues/PRs references
the tracking pr: #11660
reason for sched_switch instead of thread_yield_higher: #11759, #11660 (comment)