Cleaning up when kill signal is sent to the thread.?
> I’m writing a multi-threaded daemon, which requires some cleanup if a > kill signal is sent to the thread. I want just the thread that received > the signal to exit. > > The platform is Linux 2.0, libc 5.4.23, linuxthreads 0.6 (99% POSIX > threads). > > The docs indicate that threads share signal functions, but can > individually block or accept certain signals. This is workable — but > how do I get the thread id of the thread that received the signal? > > And my next question, how portable are thread cleanup routines? > > Thanks, > > Jeff Garzik Quality news feeds > News Administrator INN Technical info, Consulting > Spinne, Inc. http://www.spinne.com/usenet/ Jeff, From the sounds of what you say, the answer is “No.” 🙂 Meaning, don’t do that. There’s a better method, cancellation. If you really want the thread to exit asynchronously, that’s the way to do it. Now, it is even more likely that a simple polling routine will do the job, and that would be even easier to write. -Bil (Th
Related Questions
- What American ally in the Middle East has for years sent assassins into other countries to kill its political enemies (a practice sometimes called exporting terrorism)?
- Why are the manufacturers sending cameras back that aren perfectly clean when they were sent in for a cleaning?.
- Cleaning up when kill signal is sent to the thread.?