* [thread] Add rt_thread_close()
This patch introduces a new function `rt_thread_close()` to enhances the
usability and maintainability by providing a dedicated mechanism for
closing threads.
- A new function `rt_thread_close()` is added to the API, providing a
standardized approach for closing threads.
- The `rt_thread_close()` function removes a thread from the thread
queue, updates its status to indicate closure, and performs the thread
timer detaching which is a embedded timer in thread object.
- Additionally, the `rt_thread_detach()` function is modified to utilize
`rt_thread_close()` internally, streamlining the thread detachment
process.
Signed-off-by: Shell <smokewood@qq.com>
modified: components/libc/posix/io/aio/aio.h Align comments within the aiocb structure
modified: components/libc/posix/io/epoll/epoll.c Add comments for all functions and members within structure members
modified: components/libc/posix/signal/posix_signal.c Add comments to the sigqueue function, although it does not have an internal implementation
modified: components/libc/posix/signal/posix_signal.h Added detailed explanation to all members of the rt_signal_value enumeration
/home/runner/work/rt-thread/rt-thread/components/libc/compilers/picolibc/syscall.c:24:16: warning: returning 'volatile int *' from a function with result type 'int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
return &__pico_errno;
^~~~~~~~~~~~~
/home/runner/work/rt-thread/rt-thread/components/libc/compilers/picolibc/syscall.c:30:16: warning: returning 'volatile int *' from a function with result type 'int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
return &__pico_errno;
^~~~~~~~~~~~~
/home/runner/work/rt-thread/rt-thread/components/libc/compilers/picolibc/syscall.c:33:12: warning: incompatible pointer types returning 'rt_err_t *' (aka 'long *') from a function with result type 'int *' [-Wincompatible-pointer-types]
return &tid->error;
This option is for RT-Thread Nano version.
If select this option, it will not compile components/libc
folder and only use tool chain internal libc. Normally, the
tool chain internal is only cover ISO standard (e.g. armcc),
but some tool chains' internal libc will cover more than
ISO standard (e.g. newlib).
/home/runner/work/rt-thread/rt-thread/components/libc/compilers/picolibc/syscall.c:13:5: error: conflicting types for 'pico_get_errno'
int pico_get_errno(void)
^
/opt/LLVMEmbeddedToolchainForArm-16.0.0-Linux-x86_64/bin/../lib/clang-runtimes/arm-none-eabi/armv7em_hard_fpv4_sp_d16/include/sys/errno.h:59:6: note: previous declaration is here
int *__PICOLIBC_ERRNO_FUNCTION(void);