UNIX中多个线程同时捕捉信号,信号由那个线程捕捉到?

是固定一个线程捕捉到,还是随即的?

我有这么一个程序:
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <signal.h>

pthread_key_t key;
pthread_once_t init_done = PTHREAD_ONCE_INIT;

void * thread_func(void *arg);
void thread_ini();

void sig_hdl(int signo)
{
pthread_t tid;

tid = (pthread_t)pthread_getspecific(key);
printf("thread %d caught signal.\n",tid);

}

void thread_ini()
{
/*
struct sigaction act,oact;

act.sa_handler = sig_hdl;
sigaction(SIGUSR1,&act,&oact);*/

pthread_key_create(&key,NULL);
}

void *thread_func(void *arg)
{
pthread_t tid;
int i;
struct sigaction act,oact;

pthread_once(&init_done,thread_ini);

act.sa_handler = sig_hdl;
sigaction(SIGUSR1,&act,&oact);

tid = pthread_self();
printf("thread %d created.\n",tid);
pthread_setspecific(key,(void *)tid);

for(;;)
pause();
}

int main(int argc, char *argv[])
{
pthread_t ntid;
pthread_t mtid;
pthread_create(&ntid,NULL,thread_func,NULL);
pthread_create(&mtid,NULL,thread_func,(void*)1);
pthread_join(ntid,NULL);
pthread_join(mtid,NULL);

return 0;
}

向这个程序发SIGUSR1信号为什么只有线程1捕捉到,线程2从来没有捕捉到过
[1440 byte] By [wuliang416-Rick] at [2008-4-9]
# 1
所有子线程共享信号。如果不在线程屏蔽信号的话,谁收到信号是不确定的。
fytzzh-我爱summer at 2007-10-22 > top of Msdn China Tech,Linux/Unix社区,程序开发...
# 2
鉴于电信行业的所有程序都是运行在Unix服务器下,熟练掌握Unix已经成为从事电信开发人员的必备技能,qq群:15530146 与Unix共舞 与开发者共同提高,欢迎Unix牛人加入,期待ing
javasqlbug-javasql虫 at 2007-10-22 > top of Msdn China Tech,Linux/Unix社区,程序开发...