version 1.74, 2013/03/01 10:24:49
|
version 1.86, 2013/06/21 14:15:56
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.13 |
RPL/2 (R) version 4.1.15 |
Copyright (C) 1989-2013 Dr. BERTRAND Joël |
Copyright (C) 1989-2013 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
Line 245 instruction_wait(struct_processus *s_eta
|
Line 245 instruction_wait(struct_processus *s_eta
|
return; |
return; |
} |
} |
|
|
temporisation.tv_sec = (long) floor((double) attente); |
temporisation.tv_sec = (time_t) floor((double) attente); |
temporisation.tv_nsec = (attente - temporisation.tv_sec) * |
temporisation.tv_nsec = (long) ((attente - |
(long) 1000000000; |
((real8) temporisation.tv_sec)) * (integer8) 1000000000); |
|
|
if ((*s_etat_processus).profilage == d_vrai) |
if ((*s_etat_processus).profilage == d_vrai) |
{ |
{ |
Line 289 instruction_wait(struct_processus *s_eta
|
Line 289 instruction_wait(struct_processus *s_eta
|
|
|
scrutation_injection(s_etat_processus); |
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) |
if ((*s_etat_processus).nombre_interruptions_non_affectees != 0) |
{ |
{ |
affectation_interruptions_logicielles(s_etat_processus); |
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) |
if ((*s_etat_processus).nombre_interruptions_en_queue != 0) |
{ |
{ |
traitement_interruptions_logicielles(s_etat_processus); |
traitement_interruptions_logicielles(s_etat_processus); |
Line 390 instruction_write(struct_processus *s_et
|
Line 404 instruction_write(struct_processus *s_et
|
integer8 clef; |
integer8 clef; |
integer8 compteur; |
integer8 compteur; |
integer8 id; |
integer8 id; |
|
integer8 longueur; |
|
integer8 longueur_effective; |
integer8 ordre; |
integer8 ordre; |
|
integer8 recursivite; |
|
|
logical1 format_degenere; |
logical1 format_degenere; |
logical1 mise_a_jour; |
logical1 mise_a_jour; |
|
|
long longueur; |
|
long longueur_effective; |
|
long recursivite; |
|
|
|
sqlite3_stmt *ppStmt; |
sqlite3_stmt *ppStmt; |
|
|
Line 592 instruction_write(struct_processus *s_et
|
Line 606 instruction_write(struct_processus *s_et
|
if ((chaine = formateur_fichier(s_etat_processus, |
if ((chaine = formateur_fichier(s_etat_processus, |
s_objet_argument_2, (*((struct_fichier *) |
s_objet_argument_2, (*((struct_fichier *) |
(*s_objet_argument_1).objet)).format, 0, 0, ' ', 'F', |
(*s_objet_argument_1).objet)).format, 0, 0, ' ', 'F', |
&longueur_effective, &recursivite)) == NULL) |
&longueur_effective, &recursivite, d_vrai)) == NULL) |
{ |
{ |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
Line 674 instruction_write(struct_processus *s_et
|
Line 688 instruction_write(struct_processus *s_et
|
if ((chaine = formateur_fichier(s_etat_processus, |
if ((chaine = formateur_fichier(s_etat_processus, |
s_objet_argument_3, (*((struct_fichier *) |
s_objet_argument_3, (*((struct_fichier *) |
(*s_objet_argument_1).objet)).format, 0, 0, ' ', |
(*s_objet_argument_1).objet)).format, 0, 0, ' ', |
'F', &longueur_effective, &recursivite)) == NULL) |
'F', &longueur_effective, &recursivite, d_vrai)) |
|
== NULL) |
{ |
{ |
liberation(s_etat_processus, s_objet_argument_3); |
liberation(s_etat_processus, s_objet_argument_3); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
Line 709 instruction_write(struct_processus *s_et
|
Line 724 instruction_write(struct_processus *s_et
|
free(chaine_utf8); |
free(chaine_utf8); |
|
|
if (sqlite3_prepare_v2((*descripteur).descripteur_sqlite, |
if (sqlite3_prepare_v2((*descripteur).descripteur_sqlite, |
commande, strlen(commande), &ppStmt, &queue) |
commande, (int) strlen(commande), &ppStmt, &queue) |
!= SQLITE_OK) |
!= SQLITE_OK) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
Line 756 instruction_write(struct_processus *s_et
|
Line 771 instruction_write(struct_processus *s_et
|
} |
} |
|
|
if (sqlite3_prepare_v2((*descripteur).descripteur_sqlite, |
if (sqlite3_prepare_v2((*descripteur).descripteur_sqlite, |
commande, strlen(commande), &ppStmt, &queue) |
commande, (int) strlen(commande), &ppStmt, &queue) |
!= SQLITE_OK) |
!= SQLITE_OK) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
Line 897 instruction_write(struct_processus *s_et
|
Line 912 instruction_write(struct_processus *s_et
|
|
|
if ((chaine = formateur_fichier(s_etat_processus, |
if ((chaine = formateur_fichier(s_etat_processus, |
s_element, s_format, 0, 0, ' ', |
s_element, s_format, 0, 0, ' ', |
'F', &longueur_effective, &recursivite)) == NULL) |
'F', &longueur_effective, &recursivite, d_vrai)) |
|
== NULL) |
{ |
{ |
liberation(s_etat_processus, s_element); |
liberation(s_etat_processus, s_element); |
liberation(s_etat_processus, s_format); |
liberation(s_etat_processus, s_format); |
Line 932 instruction_write(struct_processus *s_et
|
Line 948 instruction_write(struct_processus *s_et
|
} |
} |
|
|
if (sqlite3_prepare_v2((*descripteur).descripteur_sqlite, |
if (sqlite3_prepare_v2((*descripteur).descripteur_sqlite, |
commande, strlen(commande), &ppStmt, &queue) |
commande, (int) strlen(commande), &ppStmt, &queue) |
!= SQLITE_OK) |
!= SQLITE_OK) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
Line 978 instruction_write(struct_processus *s_et
|
Line 994 instruction_write(struct_processus *s_et
|
} |
} |
|
|
if (sqlite3_prepare_v2((*descripteur) |
if (sqlite3_prepare_v2((*descripteur) |
.descripteur_sqlite, |
.descripteur_sqlite, commande, |
commande, strlen(commande), &ppStmt, &queue) |
(int) strlen(commande), &ppStmt, &queue) |
!= SQLITE_OK) |
!= SQLITE_OK) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
Line 1012 instruction_write(struct_processus *s_et
|
Line 1028 instruction_write(struct_processus *s_et
|
} |
} |
|
|
if (sqlite3_prepare_v2((*descripteur) |
if (sqlite3_prepare_v2((*descripteur) |
.descripteur_sqlite, |
.descripteur_sqlite, commande, |
commande, strlen(commande), &ppStmt, &queue) |
(int) strlen(commande), &ppStmt, &queue) |
!= SQLITE_OK) |
!= SQLITE_OK) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
Line 1076 instruction_write(struct_processus *s_et
|
Line 1092 instruction_write(struct_processus *s_et
|
} |
} |
|
|
if (sqlite3_prepare_v2((*descripteur).descripteur_sqlite, |
if (sqlite3_prepare_v2((*descripteur).descripteur_sqlite, |
commande, strlen(commande), &ppStmt, &queue) |
commande, (int) strlen(commande), &ppStmt, &queue) |
!= SQLITE_OK) |
!= SQLITE_OK) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
Line 1112 instruction_write(struct_processus *s_et
|
Line 1128 instruction_write(struct_processus *s_et
|
} |
} |
|
|
if (sqlite3_prepare_v2((*descripteur).descripteur_sqlite, |
if (sqlite3_prepare_v2((*descripteur).descripteur_sqlite, |
commande, strlen(commande), &ppStmt, &queue) |
commande, (int) strlen(commande), &ppStmt, &queue) |
!= SQLITE_OK) |
!= SQLITE_OK) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
(*s_etat_processus).erreur_systeme = d_es_erreur_fichier; |
Line 1211 instruction_write(struct_processus *s_et
|
Line 1227 instruction_write(struct_processus *s_et
|
|
|
if ((chaine = formateur_fichier(s_etat_processus, |
if ((chaine = formateur_fichier(s_etat_processus, |
s_element, s_format, 0, 0, ' ', |
s_element, s_format, 0, 0, ' ', |
'F', &longueur_effective, &recursivite)) == NULL) |
'F', &longueur_effective, &recursivite, d_vrai)) |
|
== NULL) |
{ |
{ |
free(clef_utf8); |
free(clef_utf8); |
|
|
Line 1247 instruction_write(struct_processus *s_et
|
Line 1264 instruction_write(struct_processus *s_et
|
} |
} |
|
|
if (sqlite3_prepare_v2((*descripteur).descripteur_sqlite, |
if (sqlite3_prepare_v2((*descripteur).descripteur_sqlite, |
commande, strlen(commande), &ppStmt, &queue) |
commande, (int) strlen(commande), &ppStmt, &queue) |
!= SQLITE_OK) |
!= SQLITE_OK) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
Line 1304 instruction_write(struct_processus *s_et
|
Line 1321 instruction_write(struct_processus *s_et
|
* Fichiers non formatés |
* Fichiers non formatés |
*/ |
*/ |
|
|
if ((chaine = formateur_fichier(s_etat_processus, |
|
s_objet_argument_2, (*((struct_fichier *) |
|
(*s_objet_argument_1).objet)).format, 0, 0, ' ', 'U', |
|
&longueur_effective, &recursivite)) == NULL) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
|
|
return; |
|
} |
|
|
|
if ((*((struct_fichier *) (*s_objet_argument_1).objet)).acces |
if ((*((struct_fichier *) (*s_objet_argument_1).objet)).acces |
== 'S') |
== 'S') |
{ |
{ |
|
if ((*s_objet_argument_2).type != LST) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_erreur_type_argument; |
|
return; |
|
} |
|
|
|
if ((chaine = formateur_fichier(s_etat_processus, |
|
s_objet_argument_2, (*((struct_fichier *) |
|
(*s_objet_argument_1).objet)).format, 0, 0, ' ', 'U', |
|
&longueur_effective, &recursivite, d_vrai)) == NULL) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
|
|
return; |
|
} |
|
|
BUG(((*descripteur).type != 'C'), uprintf("Bad filetype !\n")); |
BUG(((*descripteur).type != 'C'), uprintf("Bad filetype !\n")); |
|
|
if (fseek((*descripteur).descripteur_c, (long) 0, SEEK_END) |
if (fseek((*descripteur).descripteur_c, (long) 0, SEEK_END) |
Line 1330 instruction_write(struct_processus *s_et
|
Line 1357 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
if (fwrite(chaine, sizeof(unsigned char), longueur_effective, |
if (fwrite(chaine, sizeof(unsigned char), |
|
(size_t) longueur_effective, |
(*descripteur).descripteur_c) != |
(*descripteur).descripteur_c) != |
(size_t) longueur_effective) |
(size_t) longueur_effective) |
{ |
{ |
Line 1341 instruction_write(struct_processus *s_et
|
Line 1369 instruction_write(struct_processus *s_et
|
else if ((*((struct_fichier *) (*s_objet_argument_1).objet)).acces |
else if ((*((struct_fichier *) (*s_objet_argument_1).objet)).acces |
== 'D') |
== 'D') |
{ |
{ |
|
if ((*s_objet_argument_2).type != INT) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_erreur_type_argument; |
|
return; |
|
} |
|
|
|
if (depilement(s_etat_processus, &((*s_etat_processus) |
|
.l_base_pile), &s_objet_argument_3) == d_erreur) |
|
{ |
|
(*s_etat_processus).erreur_execution = d_ex_manque_argument; |
|
return; |
|
} |
|
|
|
if ((*s_objet_argument_3).type != LST) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_3); |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_erreur_type_argument; |
|
return; |
|
} |
|
|
|
if ((chaine = formateur_fichier(s_etat_processus, |
|
s_objet_argument_2, (*((struct_fichier *) |
|
(*s_objet_argument_1).objet)).format, 0, 0, ' ', 'U', |
|
&longueur_effective, &recursivite, d_faux)) == NULL) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
|
|
return; |
|
} |
} |
} |
else |
else // Fichiers indexés |
{ |
{ |
/* Fichiers indexés : panique totale ! */ |
if ((*s_objet_argument_2).type != LST) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
|
|
(*s_etat_processus).erreur_execution = |
|
d_ex_erreur_type_argument; |
|
return; |
|
} |
|
|
|
if ((chaine = formateur_fichier(s_etat_processus, |
|
s_objet_argument_2, (*((struct_fichier *) |
|
(*s_objet_argument_1).objet)).format, 0, 0, ' ', 'U', |
|
&longueur_effective, &recursivite, d_faux)) == NULL) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
|
|
return; |
|
} |
} |
} |
|
|
free(chaine); |
free(chaine); |
Line 1430 instruction_write(struct_processus *s_et
|
Line 1515 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
longueur = strlen(format_chaine); |
longueur = (integer8) strlen(format_chaine); |
|
|
if (format_chaine[longueur - 1] != ')') |
if (format_chaine[longueur - 1] != ')') |
{ |
{ |
Line 1455 instruction_write(struct_processus *s_et
|
Line 1540 instruction_write(struct_processus *s_et
|
// Détermination de la longueur |
// Détermination de la longueur |
format_degenere = d_faux; |
format_degenere = d_faux; |
|
|
if (sscanf(&(format_chaine[8]), "%ld", &longueur) != 1) |
if (sscanf(&(format_chaine[8]), "%lld", &longueur) != 1) |
{ |
{ |
free(format_chaine); |
free(format_chaine); |
|
|
Line 1483 instruction_write(struct_processus *s_et
|
Line 1568 instruction_write(struct_processus *s_et
|
(longueur_effective < longueur)) |
(longueur_effective < longueur)) |
{ |
{ |
if (fwrite(chaine, sizeof(unsigned char), |
if (fwrite(chaine, sizeof(unsigned char), |
longueur_effective, |
(size_t) longueur_effective, |
(*descripteur).descripteur_c) != |
(*descripteur).descripteur_c) != |
(size_t) longueur_effective) |
(size_t) longueur_effective) |
{ |
{ |
Line 1495 instruction_write(struct_processus *s_et
|
Line 1580 instruction_write(struct_processus *s_et
|
else |
else |
{ |
{ |
if (fwrite(chaine, sizeof(unsigned char), |
if (fwrite(chaine, sizeof(unsigned char), |
longueur_effective, |
(size_t) longueur_effective, |
(*descripteur).descripteur_c) != |
(*descripteur).descripteur_c) != |
(size_t) longueur) |
(size_t) longueur) |
{ |
{ |
Line 1560 instruction_write(struct_processus *s_et
|
Line 1645 instruction_write(struct_processus *s_et
|
if ((chaine = formateur_fichier(s_etat_processus, |
if ((chaine = formateur_fichier(s_etat_processus, |
s_objet_argument_2, (*((struct_socket *) |
s_objet_argument_2, (*((struct_socket *) |
(*s_objet_argument_1).objet)).format, 0, 0, ' ', 'F', |
(*s_objet_argument_1).objet)).format, 0, 0, ' ', 'F', |
&longueur_effective, &recursivite)) == NULL) |
&longueur_effective, &recursivite, d_faux)) == NULL) |
{ |
{ |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
Line 1575 instruction_write(struct_processus *s_et
|
Line 1660 instruction_write(struct_processus *s_et
|
* Sockets non formatées |
* Sockets non formatées |
*/ |
*/ |
|
|
chaine = NULL; |
if ((chaine = formateur_fichier(s_etat_processus, |
|
s_objet_argument_2, (*((struct_socket *) |
|
(*s_objet_argument_1).objet)).format, 0, 0, ' ', 'U', |
|
&longueur_effective, &recursivite, d_faux)) == NULL) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
|
|
return; |
|
} |
} |
} |
else |
else |
{ |
{ |
Line 1637 instruction_write(struct_processus *s_et
|
Line 1731 instruction_write(struct_processus *s_et
|
} |
} |
|
|
if (send((*((struct_socket *) (*s_objet_argument_1).objet)) |
if (send((*((struct_socket *) (*s_objet_argument_1).objet)) |
.socket, chaine, longueur_effective, 0) < 0) |
.socket, chaine, (size_t) longueur_effective, 0) < 0) |
{ |
{ |
ios = errno; |
ios = errno; |
|
|
Line 1740 instruction_write(struct_processus *s_et
|
Line 1834 instruction_write(struct_processus *s_et
|
|
|
if (sendto((*((struct_socket *) |
if (sendto((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, chaine, |
(*s_objet_argument_1).objet)).socket, chaine, |
longueur_effective, 0, (struct sockaddr *) |
(size_t) longueur_effective, 0, (struct sockaddr *) |
&adresse_unix, sizeof(adresse_unix)) < 0) |
&adresse_unix, sizeof(adresse_unix)) < 0) |
{ |
{ |
ios = errno; |
ios = errno; |
Line 1801 instruction_write(struct_processus *s_et
|
Line 1895 instruction_write(struct_processus *s_et
|
{ // Adresse IPv4 |
{ // Adresse IPv4 |
calcul_adresse = 0; |
calcul_adresse = 0; |
for(i = 0; i < 4; calcul_adresse = |
for(i = 0; i < 4; calcul_adresse = |
(256 * calcul_adresse) + adresse[i++]); |
(256 * calcul_adresse) + |
|
((unsigned char) adresse[i++])); |
|
|
memset(&adresse_ipv4, 0, sizeof(adresse_ipv4)); |
memset(&adresse_ipv4, 0, sizeof(adresse_ipv4)); |
adresse_ipv4.sin_family = AF_INET; |
adresse_ipv4.sin_family = AF_INET; |
adresse_ipv4.sin_port = htons(port); |
adresse_ipv4.sin_port = htons((uint16_t) port); |
adresse_ipv4.sin_addr.s_addr = htonl(calcul_adresse); |
adresse_ipv4.sin_addr.s_addr = htonl(calcul_adresse); |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
Line 1821 instruction_write(struct_processus *s_et
|
Line 1916 instruction_write(struct_processus *s_et
|
|
|
if (sendto((*((struct_socket *) |
if (sendto((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, chaine, |
(*s_objet_argument_1).objet)).socket, chaine, |
longueur_effective, 0, (struct sockaddr *) |
(size_t) longueur_effective, 0, (struct sockaddr *) |
&adresse_ipv4, sizeof(adresse_ipv4)) < 0) |
&adresse_ipv4, sizeof(adresse_ipv4)) < 0) |
{ |
{ |
ios = errno; |
ios = errno; |
Line 1905 instruction_write(struct_processus *s_et
|
Line 2000 instruction_write(struct_processus *s_et
|
|
|
for(i = 0; i < 16; |
for(i = 0; i < 16; |
adresse_ipv6.sin6_addr.s6_addr[i] = |
adresse_ipv6.sin6_addr.s6_addr[i] = |
adresse[i], i++); |
(unsigned char) adresse[i], i++); |
|
|
# ifndef SEMAPHORES_NOMMES |
# ifndef SEMAPHORES_NOMMES |
if (sem_post(&((*s_etat_processus).semaphore_fork)) |
if (sem_post(&((*s_etat_processus).semaphore_fork)) |
Line 1920 instruction_write(struct_processus *s_et
|
Line 2015 instruction_write(struct_processus *s_et
|
|
|
if (sendto((*((struct_socket *) |
if (sendto((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, chaine, |
(*s_objet_argument_1).objet)).socket, chaine, |
longueur_effective, 0, (struct sockaddr *) |
(size_t) longueur_effective, 0, (struct sockaddr *) |
&adresse_ipv6, sizeof(adresse_ipv6)) < 0) |
&adresse_ipv6, sizeof(adresse_ipv6)) < 0) |
{ |
{ |
ios = errno; |
ios = errno; |
Line 2198 instruction_wflock(struct_processus *s_e
|
Line 2293 instruction_wflock(struct_processus *s_e
|
} |
} |
else |
else |
{ |
{ |
|
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) |
if ((*s_etat_processus).nombre_interruptions_non_affectees != 0) |
{ |
{ |
affectation_interruptions_logicielles(s_etat_processus); |
affectation_interruptions_logicielles(s_etat_processus); |
} |
} |
|
|
if ((*s_etat_processus).nombre_interruptions_en_queue |
if (pthread_mutex_unlock(&(*s_etat_processus) |
!= 0) |
.mutex_interruptions) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
if ((*s_etat_processus).nombre_interruptions_en_queue != 0) |
{ |
{ |
registre_instruction_valide = |
registre_instruction_valide = |
(*s_etat_processus).instruction_valide; |
(*s_etat_processus).instruction_valide; |
Line 2318 instruction_wfproc(struct_processus *s_e
|
Line 2426 instruction_wfproc(struct_processus *s_e
|
} |
} |
} |
} |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex)) != 0) |
if (pthread_mutex_lock(&((*s_etat_processus).mutex_pile_processus)) |
|
!= 0) |
{ |
{ |
if ((*s_etat_processus).profilage == d_vrai) |
if ((*s_etat_processus).profilage == d_vrai) |
{ |
{ |
Line 2383 instruction_wfproc(struct_processus *s_e
|
Line 2492 instruction_wfproc(struct_processus *s_e
|
profilage(s_etat_processus, NULL); |
profilage(s_etat_processus, NULL); |
} |
} |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
if (pthread_mutex_unlock(&((*s_etat_processus) |
|
.mutex_pile_processus)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 2463 instruction_wfproc(struct_processus *s_e
|
Line 2573 instruction_wfproc(struct_processus *s_e
|
* Le processus n'est pas terminé |
* Le processus n'est pas terminé |
*/ |
*/ |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
if (pthread_mutex_lock(&((*s_etat_processus) |
|
.mutex_interruptions)) != 0) |
{ |
{ |
|
pthread_mutex_unlock(&((*s_etat_processus) |
|
.mutex_pile_processus)); |
|
|
if ((*s_etat_processus).profilage == d_vrai) |
if ((*s_etat_processus).profilage == d_vrai) |
{ |
{ |
profilage(s_etat_processus, NULL); |
profilage(s_etat_processus, NULL); |
Line 2481 instruction_wfproc(struct_processus *s_e
|
Line 2595 instruction_wfproc(struct_processus *s_e
|
affectation_interruptions_logicielles(s_etat_processus); |
affectation_interruptions_logicielles(s_etat_processus); |
} |
} |
|
|
if ((*s_etat_processus).nombre_interruptions_en_queue |
if (pthread_mutex_unlock(&((*s_etat_processus) |
!= 0) |
.mutex_interruptions)) != 0) |
|
{ |
|
pthread_mutex_unlock(&((*s_etat_processus) |
|
.mutex_pile_processus)); |
|
|
|
if ((*s_etat_processus).profilage == d_vrai) |
|
{ |
|
profilage(s_etat_processus, NULL); |
|
} |
|
|
|
(*s_etat_processus).erreur_systeme = |
|
d_es_processus; |
|
return; |
|
} |
|
|
|
if (pthread_mutex_unlock(&((*s_etat_processus) |
|
.mutex_pile_processus)) != 0) |
|
{ |
|
if ((*s_etat_processus).profilage == d_vrai) |
|
{ |
|
profilage(s_etat_processus, NULL); |
|
} |
|
|
|
(*s_etat_processus).erreur_systeme = |
|
d_es_processus; |
|
return; |
|
} |
|
|
|
if ((*s_etat_processus).nombre_interruptions_en_queue != 0) |
{ |
{ |
registre_instruction_valide = |
registre_instruction_valide = |
(*s_etat_processus).instruction_valide; |
(*s_etat_processus).instruction_valide; |
Line 2521 instruction_wfproc(struct_processus *s_e
|
Line 2663 instruction_wfproc(struct_processus *s_e
|
|
|
scrutation_injection(s_etat_processus); |
scrutation_injection(s_etat_processus); |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex)) != 0) |
if (pthread_mutex_lock(&((*s_etat_processus) |
|
.mutex_pile_processus)) != 0) |
{ |
{ |
if ((*s_etat_processus).profilage == d_vrai) |
if ((*s_etat_processus).profilage == d_vrai) |
{ |
{ |
Line 2543 instruction_wfproc(struct_processus *s_e
|
Line 2686 instruction_wfproc(struct_processus *s_e
|
profilage(s_etat_processus, NULL); |
profilage(s_etat_processus, NULL); |
} |
} |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
if (pthread_mutex_unlock(&((*s_etat_processus).mutex_pile_processus)) |
|
!= 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 2646 instruction_wfdata(struct_processus *s_e
|
Line 2790 instruction_wfdata(struct_processus *s_e
|
} |
} |
} |
} |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex)) != 0) |
if (pthread_mutex_lock(&((*s_etat_processus).mutex_pile_processus)) |
|
!= 0) |
{ |
{ |
if ((*s_etat_processus).profilage == d_vrai) |
if ((*s_etat_processus).profilage == d_vrai) |
{ |
{ |
Line 2706 instruction_wfdata(struct_processus *s_e
|
Line 2851 instruction_wfdata(struct_processus *s_e
|
profilage(s_etat_processus, NULL); |
profilage(s_etat_processus, NULL); |
} |
} |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
if (pthread_mutex_unlock(&((*s_etat_processus) |
|
.mutex_pile_processus)) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 2749 instruction_wfdata(struct_processus *s_e
|
Line 2895 instruction_wfdata(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
if (pthread_mutex_unlock(&((*s_etat_processus) |
|
.mutex_pile_processus)) != 0) |
{ |
{ |
if ((*s_etat_processus).profilage == d_vrai) |
if ((*s_etat_processus).profilage == d_vrai) |
{ |
{ |
Line 2790 instruction_wfdata(struct_processus *s_e
|
Line 2937 instruction_wfdata(struct_processus *s_e
|
|
|
scrutation_injection(s_etat_processus); |
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 |
if ((*s_etat_processus).nombre_interruptions_non_affectees |
!= 0) |
!= 0) |
{ |
{ |
affectation_interruptions_logicielles(s_etat_processus); |
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) |
if ((*s_etat_processus).nombre_interruptions_en_queue != 0) |
{ |
{ |
registre_instruction_valide = |
registre_instruction_valide = |
Line 2815 instruction_wfdata(struct_processus *s_e
|
Line 2976 instruction_wfdata(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
if (pthread_mutex_lock(&((*s_etat_processus).mutex)) != 0) |
if (pthread_mutex_lock(&((*s_etat_processus) |
|
.mutex_pile_processus)) != 0) |
{ |
{ |
if ((*s_etat_processus).profilage == d_vrai) |
if ((*s_etat_processus).profilage == d_vrai) |
{ |
{ |
Line 2842 instruction_wfdata(struct_processus *s_e
|
Line 3004 instruction_wfdata(struct_processus *s_e
|
profilage(s_etat_processus, NULL); |
profilage(s_etat_processus, NULL); |
} |
} |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
if (pthread_mutex_unlock(&((*s_etat_processus).mutex_pile_processus)) |
|
!= 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
Line 3526 instruction_wfswi(struct_processus *s_et
|
Line 3689 instruction_wfswi(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
|
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) |
if ((*s_etat_processus).nombre_interruptions_non_affectees != 0) |
{ |
{ |
affectation_interruptions_logicielles(s_etat_processus); |
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).queue_interruptions[interruption - 1] > 0) |
if ((*s_etat_processus).queue_interruptions[interruption - 1] > 0) |
{ |
{ |
drapeau_fin = d_vrai; |
drapeau_fin = d_vrai; |
Line 3663 instruction_wfpoke(struct_processus *s_e
|
Line 3840 instruction_wfpoke(struct_processus *s_e
|
|
|
scrutation_injection(s_etat_processus); |
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) |
if ((*s_etat_processus).nombre_interruptions_non_affectees != 0) |
{ |
{ |
affectation_interruptions_logicielles(s_etat_processus); |
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) |
if ((*s_etat_processus).nombre_interruptions_en_queue != 0) |
{ |
{ |
registre_instruction_valide = |
registre_instruction_valide = |
Line 3770 instruction_wfack(struct_processus *s_et
|
Line 3959 instruction_wfack(struct_processus *s_et
|
{ |
{ |
scrutation_injection(s_etat_processus); |
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) |
if ((*s_etat_processus).nombre_interruptions_non_affectees != 0) |
{ |
{ |
affectation_interruptions_logicielles(s_etat_processus); |
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) |
if ((*s_etat_processus).nombre_interruptions_en_queue != 0) |
{ |
{ |
registre_instruction_valide = |
registre_instruction_valide = |