3 ms·
If you just want to stop and/or kill all child threads, you can read the list of thread IDs from /proc/pid/task, and send a signal to them with tgkill().
by HarHarVeryFunny 1y ago
If you just want to stop and/or kill all child threads, you can read the list of thread IDs from /proc/pid/task, and send a signal to them with tgkill().
- eptcyka 1y agoYeah, and leave mutexes locked indefinitely.
- HarHarVeryFunny 1y agoSometimes that doesn't matter - maybe you are just trying to get the process to exit without core dumping due to running threads accessing things that are disappearing. I'm not sure there's any better solution if you are dealing with a library that creates threads and doesn't provide an API to shut them down.