patacongo commented on issue #1263: URL: https://github.com/apache/incubator-nuttx/issues/1263#issuecomment-645453543
Other, related issues noted in the TODO list: Title: ISSUES WITH atexit(), on_exit(), AND pthread_cleanup_pop() Description: These functions execute with the following bad properties: 1. They run with interrupts disabled, 2. They run in supervisor mode (if applicable), and 3. They do not obey any setup of PIC or address environments. Do they need to? 4. In the case of task_delete() and pthread_cancel() without deferred cancellation, these callbacks will run on the thread of execution and address context of the caller of task_delete() or pthread_cancel(). That is very bad! The fix for all of these issues it to have the callbacks run on the caller's thread as is currently done with signal handlers. Signals are delivered differently in PROTECTED and KERNEL modes: The delivery involves a signal handling trampoline function in the user address space and two signal handlers: One to call the signal handler trampoline in user mode (SYS_signal_handler) and on in with the signal handler trampoline to return to supervisor mode (SYS_signal_handler_return) The primary difference is in the location of the signal handling trampoline: - In PROTECTED mode, there is on a single user space blob with a header at the beginning of the block (at a well- known location. There is a pointer to the signal handler trampoline function in that header. - In the KERNEL mode, a special process signal handler trampoline is used at a well-known location in every process address space (ARCH_DATA_RESERVE->ar_sigtramp). Status: Open Priority: Medium Low. This is an important change to some less important interfaces. For the average user, these functions are just fine the way they are. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org