A few documentation typos in doxgen automatic links and release of threads Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
anotheruserofchibios
Posts: 7
Joined: Wed Aug 24, 2022 3:52 pm
Been thanked: 6 times

A few documentation typos in doxgen automatic links and release of threads  Topic is solved

Postby anotheruserofchibios » Wed Feb 12, 2025 4:15 pm

Hi,

I spotted a few typos in the documentation:

  • "Initializes s @p" -> "Initializes a @p"
  • @p bsem -> @p chBSem
  • @p chthd -> @p chThd
  • @p threads.h -> @p chschd.h
  • how to release dynamic threads and when they are removed from registry

Please find attached a single patch file containing multiple commits (one for each of the above points).

I'm not so sure about the last point but I think the documentation was not consistent everywhere. It may still be improved of course.

Kind regards,
Attachments
typos.zip
(3.72 KiB) Downloaded 489 times

User avatar
Giovanni
Site Admin
Posts: 14803
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1179 times
Been thanked: 980 times

Re: A few documentation typos in doxgen automatic links and release of threads

Postby Giovanni » Wed Feb 12, 2025 5:35 pm

Thanks, typo fixes are never enough :-)

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14803
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1179 times
Been thanked: 980 times

Re: A few documentation typos in doxgen automatic links and release of threads

Postby Giovanni » Tue Jul 01, 2025 9:55 am

Fixes committed, thanks.

Giovanni

anotheruserofchibios
Posts: 7
Joined: Wed Aug 24, 2022 3:52 pm
Been thanked: 6 times

Re: A few documentation typos in doxgen automatic links and release of threads

Postby anotheruserofchibios » Tue Jul 01, 2025 8:35 pm

Hi,

Thank you for the commit. Apparently you didn't apply the last pieces of the diff, was it intended? Specifically:

Code: Select all

diff --git a/os/rt/src/chthreads.c b/os/rt/src/chthreads.c
index 6663e4b71..56880fd42 100644
--- a/os/rt/src/chthreads.c
+++ b/os/rt/src/chthreads.c
@@ -622,10 +622,12 @@ thread_t *chThdAddRef(thread_t *tp) {
  *          returned to the proper allocator and the thread is removed
  *          from the registry.<br>
  *          Threads whose counter reaches zero and are still active become
- *          "detached" and will be removed from registry on termination.
+ *          "detached". Detached static threads will be removed from the
+ *          registry on termination. Detached non-static threads can only be
+ *          removed by performing a registry scan operation.
  * @pre     The configuration option @p CH_CFG_USE_REGISTRY must be enabled in
  *          order to use this function.
- * @note    Static threads are not affected.
+ * @note    Static threads are not affected, only removed from the registry.
  *
  * @param[in] tp        pointer to the thread
  *
@@ -741,7 +743,7 @@ void chThdExitS(msg_t msg) {
  * @details This function waits for the specified thread to terminate then
  *          decrements its reference counter, if the counter reaches zero then
  *          the thread working area is returned to the proper allocator and
- *          the thread is removed from registry.
+ *          the thread is removed from the registry.
  * @pre     The configuration option @p CH_CFG_USE_WAITEXIT must be enabled in
  *          order to use this function.
  * @post    Enabling @p chThdWait() requires 2-4 (depending on the
diff --git a/os/various/cpp_wrappers/ch.hpp b/os/various/cpp_wrappers/ch.hpp
index 72328e0b4..33bc6ca83 100644
--- a/os/various/cpp_wrappers/ch.hpp
+++ b/os/various/cpp_wrappers/ch.hpp
@@ -680,11 +680,13 @@ namespace chibios_rt {
      *          returned to the proper allocator and the thread is removed
      *          from the registry.<br>
      *          Threads whose counter reaches zero and are still active become
-     *          "detached" and will be removed from registry on termination.
+     *          "detached". Detached static threads will be removed from the
+     *          registry on termination. Detached non-static threads can only be
+     *          removed by performing a registry scan operation.
      * @pre     The configuration option @p CH_CFG_USE_REGISTRY must be enabled in
      *          order to use this function.
      * @post    The reference is set to @p nullptr.
-     * @note    Static threads are not affected.
+     * @note    Static threads are not affected, only removed from the registry.
      *
      * @api
      */

My intent was to clarify what happens for static and dynamic (i.e., non-static) threads, respectively. Because clearly, "will be removed from registry on termination" is wrong for non-static threads, and "static threads are not affected" is wrong regarding removal from the registry. Am I mistaken?

User avatar
Giovanni
Site Admin
Posts: 14803
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1179 times
Been thanked: 980 times

Re: A few documentation typos in doxgen automatic links and release of threads

Postby Giovanni » Tue Jul 01, 2025 9:04 pm

Hi,

Strange, I applied the whole thing, will do also this one tomorrow.

Giovanni

anotheruserofchibios
Posts: 7
Joined: Wed Aug 24, 2022 3:52 pm
Been thanked: 6 times

Re: A few documentation typos in doxgen automatic links and release of threads

Postby anotheruserofchibios » Wed Jul 02, 2025 12:52 pm

Still missing a few things, you should scroll the code block in my previous message. :)

anotheruserofchibios
Posts: 7
Joined: Wed Aug 24, 2022 3:52 pm
Been thanked: 6 times

Re: A few documentation typos in doxgen automatic links and release of threads

Postby anotheruserofchibios » Thu Jul 03, 2025 1:53 pm

Last bit on this line to be consistent:

Code: Select all

- * @note    Static threads are not affected.
+ * @note    Static threads are not affected, only removed from the registry.


Thank you!


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 23 guests