Skip to content

Posix: fix event_wait_timed() #346

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

Merged
merged 2 commits into from
Jun 11, 2021

Conversation

twpedersen
Copy link
Contributor

event_wait_timed() was ignoring a timeout of 1000 ms.
Presumably this is because pthread_cond_timedwait() only
considers tv_nsec less than one second.

Convert the timeout in miliseconds to second and nanosecond
components to fix this.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

event_wait_timed() was ignoring a timeout of 1000 ms.
Presumably this is because pthread_cond_timedwait() only
considers tv_nsec less than one second.

Convert the timeout in miliseconds to second and nanosecond
components to fix this.
@twpedersen twpedersen requested a review from a team as a code owner June 7, 2021 23:29
@codecov
Copy link

codecov bot commented Jun 7, 2021

Codecov Report

Merging #346 (4da552c) into main (bad8f01) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #346   +/-   ##
=======================================
  Coverage   92.13%   92.13%           
=======================================
  Files           4        4           
  Lines        1272     1272           
  Branches      342      342           
=======================================
  Hits         1172     1172           
  Misses         53       53           
  Partials       47       47           
Flag Coverage Δ
unittests 92.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bad8f01...4da552c. Read the comment docs.

//ts.tv_sec += ms;
ts.tv_nsec += (ms * 1000000);
ts.tv_sec += ms / 1000;
ts.tv_nsec += ((ms % 1000) * 1000000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch.. thanks!

@mingyue86010 mingyue86010 merged commit 6a84f2c into FreeRTOS:main Jun 11, 2021
laroche pushed a commit to laroche/FreeRTOS-Kernel that referenced this pull request Apr 18, 2024
… commits (FreeRTOS#346)

This updates submodules for coreMQTT, coreJSON, and AWS Device Shadow. Some of which contain library fixes.

* Update coreMQTT to latest commit

* Update submodules for coreJSON and AWS Device Shadow to latest commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants