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

Fixed condition variable timed wait. #1560

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

fpagliughi
Copy link
Contributor

@fpagliughi fpagliughi commented Jan 13, 2025

On doing some performance tests, I noticed that the condition variable timed wait function Thread_wait_cond() was occasionally returning EINVAL because the timespec value given to it was not properly normalized.

This fixes the normalization, and also checks that the input value of timeout_ms is greater than zero. Anything <= 0 will timeout immediately, which seems sensible, but will not attempt any (possibly erroneous) time offset math,

This also updates the thread test app (test/thread.c) for current implementation of the signal types. For example, the application was testing for a counting semaphore whereas the current implementation is of a binary semaphore. Thus, fixes #1557

@fpagliughi fpagliughi changed the base branch from master to develop January 13, 2025 14:54
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.

1 participant