--- rpl/src/instructions_c6.c 2011/07/22 07:38:36 1.27 +++ rpl/src/instructions_c6.c 2012/10/01 11:05:03 1.42 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.1 - Copyright (C) 1989-2011 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.11 + Copyright (C) 1989-2012 Dr. BERTRAND Joël This file is part of RPL/2. @@ -608,8 +608,10 @@ instruction_continue(struct_processus *s .thread).pid == (*(*((struct_processus_fils *) (*(*l_element_courant).donnee).objet)).thread).pid) { - if (kill((*(*((struct_processus_fils *) - (*s_objet).objet)).thread).pid, SIGCONT) != 0) + if (envoi_signal_processus( + (*(*((struct_processus_fils *) + (*s_objet).objet)).thread).pid, rpl_sigcont) + != 0) { // Le processus est peut-être dans l'état zombie. } @@ -639,8 +641,9 @@ instruction_continue(struct_processus *s (*(*l_element_courant).donnee).objet)).thread) .pid)) { - if (pthread_kill((*(*((struct_processus_fils *) - (*s_objet).objet)).thread).tid, SIGCONT) + if (envoi_signal_thread( + (*(*((struct_processus_fils *) + (*s_objet).objet)).thread).tid, rpl_sigcont) != 0) { // Le thread est peut-être dans l'état zombie. @@ -833,66 +836,67 @@ instruction_clrfuse(struct_processus *s_ ================================================================================ */ -void -instruction_crtab(struct_processus *s_etat_processus) +static struct_objet * +creation_table(struct_processus *s_etat_processus, + struct_liste_chainee *dimensions) { - struct_liste_chainee *l_element_courant; + struct_objet *s_table; - struct_objet *s_objet_argument; - struct_objet *s_objet_resultat; + unsigned long i; - struct_objet * - creation_table(struct_liste_chainee *dimensions) + if ((s_table = allocation(s_etat_processus, TBL)) == NULL) { - struct_objet *s_table; - - unsigned long i; - - if ((s_table = allocation(s_etat_processus, TBL)) == NULL) - { - return(NULL); - } + return(NULL); + } - (*((struct_tableau *) (*s_table).objet)).nombre_elements = - (unsigned long) (*((integer8 *) (*(*dimensions).donnee).objet)); + (*((struct_tableau *) (*s_table).objet)).nombre_elements = + (unsigned long) (*((integer8 *) (*(*dimensions).donnee).objet)); - dimensions = (*dimensions).suivant; + dimensions = (*dimensions).suivant; - if (((*((struct_tableau *) (*s_table).objet)).elements = - malloc((*((struct_tableau *) (*s_table).objet)) - .nombre_elements * sizeof(struct_objet *))) == NULL) - { - return(NULL); - } + if (((*((struct_tableau *) (*s_table).objet)).elements = + malloc((*((struct_tableau *) (*s_table).objet)) + .nombre_elements * sizeof(struct_objet *))) == NULL) + { + return(NULL); + } - if (dimensions == NULL) + if (dimensions == NULL) + { + for(i = 0; i < (*((struct_tableau *) (*s_table).objet)) + .nombre_elements; i++) { - for(i = 0; i < (*((struct_tableau *) (*s_table).objet)) - .nombre_elements; i++) + if (((*((struct_tableau *) (*s_table).objet)).elements[i] = + allocation(s_etat_processus, LST)) == NULL) { - if (((*((struct_tableau *) (*s_table).objet)).elements[i] = - allocation(s_etat_processus, LST)) == NULL) - { - return(NULL); - } + return(NULL); } } - else + } + else + { + for(i = 0; i < (*((struct_tableau *) (*s_table).objet)) + .nombre_elements; i++) { - for(i = 0; i < (*((struct_tableau *) (*s_table).objet)) - .nombre_elements; i++) + if (((*((struct_tableau *) (*s_table).objet)).elements[i] = + creation_table(s_etat_processus, dimensions)) == NULL) { - if (((*((struct_tableau *) (*s_table).objet)).elements[i] = - creation_table(dimensions)) == NULL) - { - return(NULL); - } + return(NULL); } } - - return(s_table); } + return(s_table); +} + +void +instruction_crtab(struct_processus *s_etat_processus) +{ + struct_liste_chainee *l_element_courant; + + struct_objet *s_objet_argument; + struct_objet *s_objet_resultat; + (*s_etat_processus).erreur_execution = d_ex; if ((*s_etat_processus).affichage_arguments == 'Y') @@ -961,8 +965,8 @@ instruction_crtab(struct_processus *s_et l_element_courant = (*l_element_courant).suivant; } - if ((s_objet_resultat = - creation_table((*s_objet_argument).objet)) == NULL) + if ((s_objet_resultat = creation_table(s_etat_processus, + (*s_objet_argument).objet)) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return;