This repository has been archived by the owner on Jun 19, 2024. It is now read-only.
Only exit on panic in custom tasks #46
Labels
scope:platform_support
Updates Rust support (e.g. panic handler, allocator, etc)
type:enhancement
New feature or request
What's the motivation for this feature?
The current panic handler will exit the entire program on a panic. However, it may improve reliability to keep the program running if a sub-task panics.
Describe the solution you'd like
Unwind and run destructors on panic, then if it's the main/entrypoint task, exit
Describe the drawbacks, if any
We would have to figure out how to get unwinding working. Also continuing the program could cause some sort of invalid state if using incorrectly.
Describe the alternative solutions, if any
We could just delete the current task instead of unwinding. This would mean destructors aren't run and memory isn't deallocated. We would have to store a list of mutexes that are locked by the current task and poison them.
Additional context
I know PROS does some unwinding stuff related to C++ destructors, so it might be possible to hook into those APIs.
The text was updated successfully, but these errors were encountered: