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: pthread: implement pthread_setschedprio #71001
posix: pthread: implement pthread_setschedprio #71001
Conversation
704e3d5
to
78edaf2
Compare
@moonlight83340 - probably one more test is needed under |
|
Will do that thank you ! (sorry, I close by misstake 😅 ) |
eb2bd1d
to
36dc0ce
Compare
36dc0ce
to
54bc59c
Compare
54bc59c
to
1f71687
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.
LGTM
lib/posix/options/pthread.c
Outdated
int ret = 0; | ||
int new_prio = K_LOWEST_APPLICATION_THREAD_PRIO; | ||
struct posix_thread *t = NULL; | ||
int policy = 0; |
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 only new_prio
needs to be initialized?
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.
int ret = 0; | |
int new_prio = K_LOWEST_APPLICATION_THREAD_PRIO; | |
struct posix_thread *t = NULL; | |
int policy = 0; | |
int ret = 0; | |
int new_prio = K_LOWEST_APPLICATION_THREAD_PRIO; | |
struct posix_thread *t = NULL; | |
int policy; |
ret and t should be initialized I think.
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.
ret
isn't used before L885 and will be assigned at L885
the initialization of t
is probably required here, since it is used in L906
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.
int ret = 0; | |
int new_prio = K_LOWEST_APPLICATION_THREAD_PRIO; | |
struct posix_thread *t = NULL; | |
int policy = 0; | |
int ret; | |
int new_prio = K_LOWEST_APPLICATION_THREAD_PRIO; | |
struct posix_thread *t = NULL; | |
int policy; |
Implement posix pthread_setschedprio() Signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
Add tests for pthread_setschedprio() Signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
1f71687
to
e4ad4a0
Compare
I noticed that pthread_setschedprio() was mentioned in the documentation but hasn't actually been implemented yet :
https://github.com/search?q=repo%3Azephyrproject-rtos%2Fzephyr+setschedprio&type=code
Therefore, I decided to implement it based on the information provided here: :
https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_setschedprio.html