version 1.30, 2010/08/17 11:59:28
|
version 1.31, 2010/08/17 14:15:20
|
Line 1774 queue_de_signal(int signal)
|
Line 1774 queue_de_signal(int signal)
|
switch(signal) |
switch(signal) |
{ |
{ |
case SIGINT: |
case SIGINT: |
|
BUG(1, uprintf("SIGINT is not queued as it does not " |
|
"come from program itself !\n")); |
return(0); |
return(0); |
case SIGTSTP: |
case SIGTSTP: |
return(1); |
return(1); |
Line 1929 creation_fifos_signaux(struct_processus
|
Line 1931 creation_fifos_signaux(struct_processus
|
*/ |
*/ |
|
|
pthread_mutexattr_init(&attributs_mutex); |
pthread_mutexattr_init(&attributs_mutex); |
pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL); |
pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE); |
|
|
for(i = 0; i < nombre_queues; i++) |
for(i = 0; i < nombre_queues; i++) |
{ |
{ |
Line 1962 void
|
Line 1964 void
|
destruction_fifos_signaux(struct_processus *s_etat_processus) |
destruction_fifos_signaux(struct_processus *s_etat_processus) |
{ |
{ |
int i; |
int i; |
|
|
unsigned char *nom; |
unsigned char *nom; |
|
|
if (shmdt(fifos) == -1) |
if (shmdt(fifos) == -1) |
Line 2124 origine_signal(int signal)
|
Line 2127 origine_signal(int signal)
|
|
|
if (pthread_mutex_lock(&(mutexes[queue])) != 0) |
if (pthread_mutex_lock(&(mutexes[queue])) != 0) |
{ |
{ |
perror("lock"); |
|
return(-1); |
return(-1); |
} |
} |
|
|
Line 2136 origine_signal(int signal)
|
Line 2138 origine_signal(int signal)
|
|
|
if (base[3] > base[2]) |
if (base[3] > base[2]) |
{ |
{ |
uprintf("Base\n"); |
|
pthread_mutex_unlock(&(mutexes[queue])); |
pthread_mutex_unlock(&(mutexes[queue])); |
return(-1); |
return(-1); |
} |
} |
Line 2163 interruption1(SIGHANDLER_ARGS)
|
Line 2164 interruption1(SIGHANDLER_ARGS)
|
volatile sig_atomic_t exclusion = 0; |
volatile sig_atomic_t exclusion = 0; |
|
|
# ifdef _BROKEN_SIGINFO |
# ifdef _BROKEN_SIGINFO |
pid = origine_signal(signal); |
if (signal == SIGINT) |
|
{ |
|
// Si l'interruption provient du clavier, il n'y a pas eu d'appel |
|
// à queue_in(). |
|
|
|
pid = getpid(); |
|
} |
|
else |
|
{ |
|
pid = origine_signal(signal); |
|
} |
# else |
# else |
pid = (*siginfo).si_pid; |
pid = (*siginfo).si_pid; |
# endif |
# endif |
Line 2880 rpl_kill(pid_t pid, int signal)
|
Line 2891 rpl_kill(pid_t pid, int signal)
|
* queue. |
* queue. |
*/ |
*/ |
|
|
if (signal != 0) |
if ((signal != 0) && (signal != SIGINT)) |
{ |
{ |
if (queue_in(pid, signal) != 0) |
if (queue_in(pid, signal) != 0) |
{ |
{ |
Line 2894 rpl_kill(pid_t pid, int signal)
|
Line 2905 rpl_kill(pid_t pid, int signal)
|
int |
int |
rpl_pthread_kill(pthread_t tid, int signal) |
rpl_pthread_kill(pthread_t tid, int signal) |
{ |
{ |
if (signal != 0) |
if ((signal != 0) && (signal != SIGINT)) |
{ |
{ |
if (queue_in(getpid(), signal) != 0) |
if (queue_in(getpid(), signal) != 0) |
{ |
{ |