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?