-
Notifications
You must be signed in to change notification settings - Fork 528
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
ostest:add sem protocl to priority inheritance #1358
Conversation
sem_init(&g_sem, 0, NLOWPRI_THREADS); | ||
sem_setprotocol(&g_sem, SEM_PRIO_INHERIT); |
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 not change to nxmutex?
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.
ostest is app,nxmutex is kernal,so we need add mutex for app?
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.
since this is used to test the api usage, it's better to call the core api directly instead of wrapper.
@anjiahao1 @xiaoxiang781216 |
ostest testcase use sem as lock need set protocl Signed-off-by: anjiahao <[email protected]>
if sem used as lock,need set protocl to priority inheritance, others do not need |
@masayuki2009 @pkarashchenko do you have more concern about this change? |
This is a case of counting semaphore with priority inheritance enabled. We discussed this apache/nuttx#6965 (comment) . So the question that I raise long time in the past comes again: Should priority inheritance be an option of semaphore or mutex only. In this case I'll rephrase it: Should we allow enabling of priority inheritance for non-binary semaphores. If yes, then we probably need to update many places in code with similar changes. |
Yes, but ostest is very special one, because it verify the internal detail of OS implementation, and understanding the real behavior change between the enable and disable of priority inheritance.
I don't believe that the non-binary semaphore can work well with the priority inheritance in general. The priority inheritance is meaningful only when:
|
Yeah, currently with |
Let me merge this PR since apache/nuttx#5070 has been merged. |
Summary
ostest,sem use lock need set protocl
SEM_PRIO_INHERIT
patch
impact
use sem as lock,need do is change
Testing
ostest