vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| On Mon, May 5, 2008 at 11:03 PM, Ted Unangst <ted.unangst@gmail.com> wrote: > On 5/4/08, Mark Kettenis <mark.kettenis@xs4all.nl> wrote: > > > Date: Sat, 3 May 2008 20:02:10 -0600 > > > From: Philip Guenther <guenther@gmail.com> > > > > > > > > Redirect kill(getpid(), sig) to the current thread. Make > > > pthread_suspend_np(main_thread) work. > > > > > > I think this isn't quite right. POSIX says for kill(2) that: > > > > "If the value of pid causes sig to be generated for the sending > > process, and if sig is not blocked for the calling thread and if no > > other thread has sig unblocked or is waiting in a sigwait() > > function for sig, either sig or at least one pending unblocked > > signal shall be delivered to the sending thread before kill() > > returns." > > > > I think this needs changes in the kernel, and the kill function > > introduced will make it more difficult to do this properly. > > afaik, this is already the current behavior. sig is only guaranteed > to be delivered to the current thread if no other thread has it > unblocked. That's what happens today. Is that correct? That's true of pthreads, but not of rthreads. Currently with rthreads, kill(getpid(),sig) will send the signal to the main thread, period. If the main thread has the signal blocked then it'll be left pending there, even if the current thread doesn't have it blocked. Philip Guenther |