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

Comment on posix condition variable implementation looks bogus #419

Open
wucke13 opened this issue Nov 20, 2024 · 4 comments
Open

Comment on posix condition variable implementation looks bogus #419

wucke13 opened this issue Nov 20, 2024 · 4 comments

Comments

@wucke13
Copy link

wucke13 commented Nov 20, 2024

  • COndition -> Condition
  • "into a semaphore a cast" ? With the double space between "semaphore" and 'a'?

/* Simply convert the COndition variable control block into a semaphore a cast */

@fdesbiens
Copy link
Contributor

fdesbiens commented Nov 21, 2024

Thanks for raising this issue, @wucke13.

Looking at the code, I think the comment should read:

Simply convert the condition variable control block into a semaphore pointer.

What do you think?

@jserv
Copy link

jserv commented Nov 21, 2024

The comment can be refined as following:

--- a/utility/rtos_compatibility_layers/posix/px_cond_signal.c
+++ b/utility/rtos_compatibility_layers/posix/px_cond_signal.c
@@ -89,7 +89,7 @@ TX_SEMAPHORE        *semaphore_ptr;
 UINT                 status;
 
     /* Get the condition variable's internal semaphore.  */
-    /* Simply convert the COndition variable control block into a semaphore  a cast */ 
+    /* Simply convert the condition variable control block into a semaphore using casting */
     semaphore_ptr = (&( cond->cond_semaphore ));
     if ( semaphore_ptr->tx_semaphore_suspended_count)
     {

@wucke13
Copy link
Author

wucke13 commented Nov 22, 2024

Seems sensible to me!

@fdesbiens
Copy link
Contributor

@wucke13 Just to confirm I will make the change. I will take care of this next week, as I am on a trip right now.

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

No branches or pull requests

3 participants