Revert "testing/ostest/cancel: joining a detached/canceled thread should return EINVAL, not ESRCH"
This reverts commit 69e497f68127cad345fd13786c5342822c58173f.
In order to ensure the detached thread obtain the correct return value from pthread_join()/pthread_cancel(), the detached thread will create joininfo to save the detached status after thread destroyed. If there are too many of detached threads in the process group, the joininfo will consume too much memory. This is not friendly to embedded MCU devices.
This commit keep the semantics as #11898 was introduced, will no longer save joininfo for detached threads to avoid wasting memory.
Summary
Revert "testing/ostest/cancel: joining a detached/canceled thread should return EINVAL, not ESRCH"
This reverts commit 69e497f68127cad345fd13786c5342822c58173f.
In order to ensure the detached thread obtain the correct return value from pthread_join()/pthread_cancel(), the detached thread will create joininfo to save the detached status after thread destroyed. If there are too many of detached threads in the process group, the joininfo will consume too much memory. This is not friendly to embedded MCU devices. This commit keep the semantics as #11898 was introduced, will no longer save joininfo for detached threads to avoid wasting memory.
Refer PR: https://github.com/apache/nuttx/pull/12106
Impact
Fix issue https://github.com/apache/nuttx/issues/12096
Testing
ostest / ci-check