Skip to content
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

Implement better way to wait for status change #677

Closed
jphickey opened this issue Dec 9, 2020 · 0 comments · Fixed by #678
Closed

Implement better way to wait for status change #677

jphickey opened this issue Dec 9, 2020 · 0 comments · Fixed by #678
Milestone

Comments

@jphickey
Copy link
Contributor

jphickey commented Dec 9, 2020

Is your feature request related to a problem? Please describe.
If the object exists but is not in the correct state to access it, then the OS_ObjectIdConvertToken() will simply loop/retry the operation using OS_TaskDelay(). This is not ideal and likely creates more delay than what is really needed.

++attempts;
if (attempts >= 5)
{
return_code = OS_ERR_OBJECT_IN_USE;
break;
}
OS_Unlock_Global(idtype);
OS_TaskDelay_Impl(attempts);
OS_Lock_Global(idtype);

Describe the solution you'd like
Should use a proper primitive to wait until the underlying state changes and wake up the task immediately.

Describe alternatives you've considered
Continue using polling w/task delays (still an option for OS types which don't have the proper primitive)

Requester Info
Joseph Hickey, Vantage Systems, Inc.

jphickey added a commit to jphickey/osal that referenced this issue Dec 9, 2020
Removes the signal mask updates from the POSIX global lock (not needed).
Adds a condition variable to the structure, which can be used to
directly wake up a waiting task rather than requiring that task to poll
the global state.
jphickey added a commit to jphickey/osal that referenced this issue Dec 11, 2020
Removes the signal mask updates from the POSIX global lock (not needed).
Adds a condition variable to the structure, which can be used to
directly wake up a waiting task rather than requiring that task to poll
the global state.
astrogeco added a commit that referenced this issue Dec 17, 2020
@skliper skliper added this to the 6.0.0 milestone Jan 4, 2021
@skliper skliper closed this as completed Feb 16, 2021
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants