-
Notifications
You must be signed in to change notification settings - Fork 82
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
Support waiting on condition variable until a specific time point #665
Conversation
PR missing one of the required labels: {'new feature', 'enhancement', 'dependencies', 'internal', 'documentation', 'breaking-change', 'bug'} |
Hello @bjsowa, thanks for your contribution. Just to make sure since your PR is in draft, do you want us to give it a look as is? |
Yes, I would like to discuss the interface first. Once it's approved, I will implement it for different ports |
OK then we'll check this a bit later, when we have time™. |
Hey @bjsowa, the approach looks fine to us. Just a note, since we're in the process of releasing Zenoh 1.0, we'll only be able to merge the changes after the release. |
PR missing one of the required labels: {'dependencies', 'enhancement', 'breaking-change', 'new feature', 'bug', 'internal', 'documentation'} |
PR missing one of the required labels: {'dependencies', 'enhancement', 'documentation', 'new feature', 'breaking-change', 'internal', 'bug'} |
PR missing one of the required labels: {'bug', 'new feature', 'breaking-change', 'dependencies', 'internal', 'documentation', 'enhancement'} |
PR missing one of the required labels: {'internal', 'enhancement', 'bug', 'new feature', 'breaking-change', 'dependencies', 'documentation'} |
PR missing one of the required labels: {'documentation', 'enhancement', 'bug', 'dependencies', 'breaking-change', 'new feature', 'internal'} |
PR missing one of the required labels: {'bug', 'dependencies', 'breaking-change', 'internal', 'enhancement', 'new feature', 'documentation'} |
I'll try to finish this PR after #821 gets merged |
4a06031
to
ff7dc08
Compare
This is ready for review but take in mind I only tested it on unix and freertos ports. I'm especially not sure about mbed, windows and emscripten ports. |
@bjsowa thanks for the PR!
|
c707624
to
57b672a
Compare
57b672a
to
284e3ba
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.
Last nit,
others LGTM
if (clock->tv_nsec >= 1000000000) { | ||
clock->tv_sec += 1; | ||
clock->tv_nsec -= 1000000000; | ||
} |
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.
if (clock->tv_nsec >= 1000000000) { | |
clock->tv_sec += 1; | |
clock->tv_nsec -= 1000000000; | |
} | |
if (clock->tv_nsec >= 1000000000) { | |
clock->tv_sec += clock->tv_nsec / 1000000000; | |
clock->tv_nsec %= 1000000000; | |
} |
This will be more accurate.
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.
Is it really necessary? Assuming the passed clock is valid (tv_nsec < 1e9) there should be at most one second that we will have to carry from tv_nsec to tv_sec
This is my proposal for supporting waiting on condition variable till a specific time point. For now, I only implemented it for unix. If this gets approved, I can implement this function for the rest of the ports.