Subj : Re: pthread_sigmask in single thread application To : comp.programming.threads From : David Schwartz Date : Tue Jan 04 2005 12:25 am "Harshana" wrote in message news:1104824136.945613.73110@f14g2000cwb.googlegroups.com... > Hi all, > > I have a single thread, socket based program that need to handle > SIG_CHILD when any of its child processes exits. But signals should > come only when its in select() loop. So I use pthread_sigmask() BLOCK > and UNBLOCK to prevent SIG_CHLD from coming while working outside of > select(). But recently I have noticed that signals doesn't get blocked > with pthread_sigmask(BLOCK). I have seen this kind of behaviour when > linked without -lpthread. But now irrespective of linking -lpthread > library, sigmask() doesn't work. Anyone has any idea why its happening > like this? Can anyone suggest me a solution? My advice to you is to accept the signal at any time. Just have the signal handler set a flag. Then, before/after you call 'select', just check if the flag is set, and if it is, do your reaping. DS .