version 1.211, 2019/02/17 16:08:41
|
version 1.221, 2023/11/22 10:55:15
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.31 |
RPL/2 (R) version 4.1.35 |
Copyright (C) 1989-2019 Dr. BERTRAND Joël |
Copyright (C) 1989-2023 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 315 rplinit(int argc, char *argv[], char *en
|
Line 315 rplinit(int argc, char *argv[], char *en
|
|
|
pthread_mutexattr_init(&attributs_mutex); |
pthread_mutexattr_init(&attributs_mutex); |
pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE); |
pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE); |
|
pthread_mutex_init(&mutex_liste_threads_surveillance, &attributs_mutex); |
|
pthread_mutexattr_destroy(&attributs_mutex); |
|
|
|
pthread_mutexattr_init(&attributs_mutex); |
|
pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE); |
pthread_mutex_init(&mutex_sigaction, &attributs_mutex); |
pthread_mutex_init(&mutex_sigaction, &attributs_mutex); |
pthread_mutexattr_destroy(&attributs_mutex); |
pthread_mutexattr_destroy(&attributs_mutex); |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
sem_init(&((*s_etat_processus).semaphore_fork), 0, 0); |
if (sem_init(&((*s_etat_processus).semaphore_fork), 0, 0) != 0) |
# else |
# else |
if (((*s_etat_processus).semaphore_fork = sem_init3(0, getpid(), |
if (((*s_etat_processus).semaphore_fork = sem_init3(0, getpid(), |
pthread_self(), SEM_FORK)) == SEM_FAILED) |
pthread_self(), SEM_FORK)) == SEM_FAILED) |
{ |
# endif |
liberation_contexte_cas(s_etat_processus); |
{ |
|
liberation_contexte_cas(s_etat_processus); |
if ((*s_etat_processus).langue == 'F') |
|
{ |
|
uprintf("+++Système : Mémoire insuffisante\n"); |
|
} |
|
else |
|
{ |
|
uprintf("+++System : Not enough memory\n"); |
|
} |
|
|
|
return(EXIT_FAILURE); |
if ((*s_etat_processus).langue == 'F') |
|
{ |
|
uprintf("+++Système : Mémoire insuffisante\n"); |
} |
} |
# endif |
else |
|
{ |
|
uprintf("+++System : Not enough memory\n"); |
|
} |
|
|
|
return(EXIT_FAILURE); |
|
} |
|
|
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_NORMAL); |
Line 454 rplinit(int argc, char *argv[], char *en
|
Line 459 rplinit(int argc, char *argv[], char *en
|
|
|
if ((*s_etat_processus).langue == 'F') |
if ((*s_etat_processus).langue == 'F') |
{ |
{ |
printf("+++Copyright (C) 1989 à 2018, 2019 BERTRAND Joël\n"); |
printf("+++Copyright (C) 1989 à 2022, 2023 BERTRAND Joël\n"); |
} |
} |
else |
else |
{ |
{ |
printf("+++Copyright (C) 1989 to 2018, 2019 BERTRAND Joel\n"); |
printf("+++Copyright (C) 1989 to 2022, 2023 BERTRAND Joel\n"); |
} |
} |
} |
} |
|
|
Line 843 rplinit(int argc, char *argv[], char *en
|
Line 848 rplinit(int argc, char *argv[], char *en
|
action.sa_handler = interruption5; |
action.sa_handler = interruption5; |
action.sa_flags = 0; |
action.sa_flags = 0; |
|
|
|
#if 0 |
if (sigaction(SIGPIPE, &action, NULL) != 0) |
if (sigaction(SIGPIPE, &action, NULL) != 0) |
{ |
{ |
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
Line 919 rplinit(int argc, char *argv[], char *en
|
Line 925 rplinit(int argc, char *argv[], char *en
|
|
|
return(EXIT_FAILURE); |
return(EXIT_FAILURE); |
} |
} |
|
#endif |
|
|
action.sa_handler = interruption1; |
action.sa_handler = interruption1; |
action.sa_flags = 0; |
action.sa_flags = 0; |
Line 6176 rplinit(int argc, char *argv[], char *en
|
Line 6183 rplinit(int argc, char *argv[], char *en
|
liberation_allocateur_buffer(s_etat_processus); |
liberation_allocateur_buffer(s_etat_processus); |
pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation_buffer)); |
pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation_buffer)); |
pthread_mutex_destroy(&mutex_liste_threads); |
pthread_mutex_destroy(&mutex_liste_threads); |
|
pthread_mutex_destroy(&mutex_liste_threads_surveillance); |
pthread_mutex_destroy(&mutex_sigaction); |
pthread_mutex_destroy(&mutex_sigaction); |
|
|
sys_free(s_etat_processus); |
sys_free(s_etat_processus); |