Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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().




Yeah, and leave mutexes locked indefinitely.

Sometimes 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.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: