apache / nuttx-apps

Apache NuttX Apps is a collection of tools, shells, network utilities, libraries, interpreters and can be used with the NuttX RTOS
https://nuttx.apache.org/
Apache License 2.0
264 stars 490 forks source link

Revert "testing/ostest/cancel: joining a detached/canceled thread should return EINVAL, not ESRCH" #2353

Closed anchao closed 3 months ago

anchao commented 3 months ago

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