--- rpl/src/instructions_a5.c 2013/04/05 13:07:20 1.47 +++ rpl/src/instructions_a5.c 2024/01/17 16:57:11 1.78 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.14 - Copyright (C) 1989-2013 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.36 + Copyright (C) 1989-2024 Dr. BERTRAND Joël This file is part of RPL/2. @@ -51,8 +51,6 @@ instruction_alarm(struct_processus *s_et struct_objet *s_objet_argument; - struct timeb st; - struct timespec attente; struct timeval debut_interruption; @@ -64,6 +62,7 @@ instruction_alarm(struct_processus *s_et struct tm s_time_registre; time_t alarme; + time_t st; (*s_etat_processus).erreur_execution = d_ex; @@ -149,8 +148,8 @@ instruction_alarm(struct_processus *s_et return; } - st.time = time(NULL); - s_time_actuel = localtime(&(st.time)); + st = time(NULL); + s_time_actuel = localtime(&st); l_element_courant = (*s_objet_argument).objet; s_time_alarme.tm_hour = (int) (*((integer8 *) (*(*l_element_courant) @@ -233,7 +232,7 @@ instruction_alarm(struct_processus *s_et return; } - while((duree = difftime(alarme, st.time)) < 0) + while((duree = difftime(alarme, st)) < 0) { if (specification_date == d_vrai) { @@ -272,11 +271,25 @@ instruction_alarm(struct_processus *s_et scrutation_injection(s_etat_processus); + if (pthread_mutex_lock(&((*s_etat_processus) + .mutex_interruptions)) != 0) + { + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + if ((*s_etat_processus).nombre_interruptions_non_affectees != 0) { affectation_interruptions_logicielles(s_etat_processus); } + if (pthread_mutex_unlock(&((*s_etat_processus) + .mutex_interruptions)) != 0) + { + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + if ((*s_etat_processus).nombre_interruptions_en_queue != 0) { traitement_interruptions_logicielles(s_etat_processus);