-
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
posix: minor pthread_barrier clean up #1562
posix: minor pthread_barrier clean up #1562
Conversation
@LudwigOrtmann, @authmillenon, wanna merge something? :) |
I do not feel this is in my zone of competence ;-) |
Sorry, I'm overly busy atm. Assign me if you want me to take a look when I'm free again. |
Sorry I didn't realized I was assigned. I will have a look this afternoon. |
} | ||
barrier->next = NULL; | ||
barrier->count = count; | ||
} | ||
|
||
mutex_unlock(&barrier->mutex); | ||
|
||
if (switch_prio != -1) { | ||
sched_switch(switch_prio); |
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.
Ok, I don't get it, why this thread should yield()
here?
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.
When a thread with a higher priority waited on this barrier, then we need to schedule that one. Always if a thread with a higher priority gets un-blocked the current thread needs to yield.
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.
Ah ok, thx for the explanation.
ACK. |
…ranch-issue-198 posix: minor pthread_barrier clean up
This are the first two commits of #1307.
pthread_barrier_wait() needs to yield if it woke up a thread with a higher priority, and the Makefile of the accompanying test is cluttered.