The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Re: Signals and threads
       [not found] <1164362486.344548.309830@45g2000cws.googlegroups.com>
@ 2006-11-25  1:05 ` Robert Hancock
  0 siblings, 0 replies; only message in thread
From: Robert Hancock @ 2006-11-25  1:05 UTC (permalink / raw)
  To: shibu-kundara; +Cc: linux-kernel

shibu-kundara wrote:
>     Hi
> 
> I have a problem using sigaction function in pthread library.
> I have 2 thread each one registering
> 
> in threadA
>  act1.sa_handler=func1;
>  if(sigaction(SIGUSR1,&act1,NULL)) printf("\nSigaction failed! in th1
> !!\n");
> 
> in threadB
>  act1.sa_handler=func2;
>  if(sigaction(SIGUSR1,&act2,NULL)) printf("\nSigaction failed! in th2
> !!\n");
> 
> but when i send signal SIGUSR1 to threadA , threadA  receives the
> signal
> but the handler func2 is getting called,
> 
> 
> Please let me know is there any way to solve this problem?
> thanks in advance
> thomas
> 

Signal handlers are global to the process. You can't create different 
handlers for the same signal in multiple threads.

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-11-25  1:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1164362486.344548.309830@45g2000cws.googlegroups.com>
2006-11-25  1:05 ` Signals and threads Robert Hancock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox