version 1.76, 2013/03/11 11:07:25
|
version 1.96, 2015/04/14 11:26:47
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.13 |
RPL/2 (R) version 4.1.21 |
Copyright (C) 1989-2013 Dr. BERTRAND Joël |
Copyright (C) 1989-2015 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 698 instruction_write(struct_processus *s_et
|
Line 712 instruction_write(struct_processus *s_et
|
|
|
free(chaine); |
free(chaine); |
|
|
if (alsprintf(&commande, "insert or replace into data " |
if (alsprintf(s_etat_processus, &commande, |
|
"insert or replace into data " |
"(id, data) values (%lld, '%s')", (*((integer8 *) |
"(id, data) values (%lld, '%s')", (*((integer8 *) |
(*s_objet_argument_2).objet)), chaine_utf8) < 0) |
(*s_objet_argument_2).objet)), chaine_utf8) < 0) |
{ |
{ |
Line 710 instruction_write(struct_processus *s_et
|
Line 725 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 748 instruction_write(struct_processus *s_et
|
Line 763 instruction_write(struct_processus *s_et
|
|
|
// Récupération de la position de la clef |
// Récupération de la position de la clef |
|
|
if (alsprintf(&commande, "select key from control " |
if (alsprintf(s_etat_processus, &commande, |
"where id = 1") < 0) |
"select key from control where id = 1") < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
Line 757 instruction_write(struct_processus *s_et
|
Line 772 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 925 instruction_write(struct_processus *s_et
|
Line 940 instruction_write(struct_processus *s_et
|
|
|
// Récupération de l'identifiant de la clef |
// Récupération de l'identifiant de la clef |
|
|
if (alsprintf(&commande, "select id from key where key = " |
if (alsprintf(s_etat_processus, &commande, |
"'%s'", clef_utf8) < 0) |
"select id from key where key = '%s'", clef_utf8) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
Line 934 instruction_write(struct_processus *s_et
|
Line 949 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 971 instruction_write(struct_processus *s_et
|
Line 986 instruction_write(struct_processus *s_et
|
|
|
free(commande); |
free(commande); |
|
|
if (alsprintf(&commande, "insert into key " |
if (alsprintf(s_etat_processus, &commande, |
"(key) values ('%s')", clef_utf8) < 0) |
"insert into key (key) values ('%s')", |
|
clef_utf8) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
Line 980 instruction_write(struct_processus *s_et
|
Line 996 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 1005 instruction_write(struct_processus *s_et
|
Line 1021 instruction_write(struct_processus *s_et
|
|
|
free(commande); |
free(commande); |
|
|
if (alsprintf(&commande, "select id from key " |
if (alsprintf(s_etat_processus, &commande, |
"where key = '%s'", clef_utf8) < 0) |
"select id from key where key = '%s'", |
|
clef_utf8) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
Line 1014 instruction_write(struct_processus *s_et
|
Line 1031 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 1069 instruction_write(struct_processus *s_et
|
Line 1086 instruction_write(struct_processus *s_et
|
|
|
if (mise_a_jour == d_vrai) |
if (mise_a_jour == d_vrai) |
{ |
{ |
if (alsprintf(&commande, "update key set key = '%s' where " |
if (alsprintf(s_etat_processus, &commande, |
"id = %lld", clef_utf8, id) < 0) |
"update key set key = '%s' where id = %lld", |
|
clef_utf8, id) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
Line 1078 instruction_write(struct_processus *s_et
|
Line 1096 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 1105 instruction_write(struct_processus *s_et
|
Line 1123 instruction_write(struct_processus *s_et
|
|
|
// Effacement de l'enregistrement existant |
// Effacement de l'enregistrement existant |
|
|
if (alsprintf(&commande, "delete from data where " |
if (alsprintf(s_etat_processus, &commande, |
"key_id = %lld", id) < 0) |
"delete from data where key_id = %lld", id) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
Line 1114 instruction_write(struct_processus *s_et
|
Line 1132 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 1240 instruction_write(struct_processus *s_et
|
Line 1258 instruction_write(struct_processus *s_et
|
|
|
free(chaine); |
free(chaine); |
|
|
if (alsprintf(&commande, "insert into data " |
if (alsprintf(s_etat_processus, &commande, |
"(data, key_id, sequence) values " |
"insert into data (data, key_id, sequence) values " |
"('%s', %lld, %lld)", chaine_utf8, id, ordre) < 0) |
"('%s', %lld, %lld)", chaine_utf8, id, ordre) < 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
Line 1250 instruction_write(struct_processus *s_et
|
Line 1268 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 1343 instruction_write(struct_processus *s_et
|
Line 1361 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 1479 instruction_write(struct_processus *s_et
|
Line 1498 instruction_write(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
if ((format_chaine = conversion_majuscule((unsigned char *) |
if ((format_chaine = conversion_majuscule(s_etat_processus, |
(*(*l_element_courant_format).donnee).objet)) |
(unsigned char *) (*(*l_element_courant_format) |
== NULL) |
.donnee).objet)) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
Line 1500 instruction_write(struct_processus *s_et
|
Line 1519 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 1525 instruction_write(struct_processus *s_et
|
Line 1544 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 1553 instruction_write(struct_processus *s_et
|
Line 1572 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 1565 instruction_write(struct_processus *s_et
|
Line 1584 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 1645 instruction_write(struct_processus *s_et
|
Line 1664 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 1707 instruction_write(struct_processus *s_et
|
Line 1735 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 1810 instruction_write(struct_processus *s_et
|
Line 1838 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 1871 instruction_write(struct_processus *s_et
|
Line 1899 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 1891 instruction_write(struct_processus *s_et
|
Line 1920 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 1975 instruction_write(struct_processus *s_et
|
Line 2004 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 1990 instruction_write(struct_processus *s_et
|
Line 2019 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 2186 instruction_wflock(struct_processus *s_e
|
Line 2215 instruction_wflock(struct_processus *s_e
|
|
|
do |
do |
{ |
{ |
if ((chaine = conversion_majuscule((unsigned char *) |
if ((chaine = conversion_majuscule(s_etat_processus, |
(*s_objet_argument_1).objet)) == NULL) |
(unsigned char *) (*s_objet_argument_1).objet)) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 2268 instruction_wflock(struct_processus *s_e
|
Line 2297 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 2388 instruction_wfproc(struct_processus *s_e
|
Line 2430 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 2453 instruction_wfproc(struct_processus *s_e
|
Line 2496 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 2533 instruction_wfproc(struct_processus *s_e
|
Line 2577 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 2551 instruction_wfproc(struct_processus *s_e
|
Line 2599 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 2591 instruction_wfproc(struct_processus *s_e
|
Line 2667 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 2613 instruction_wfproc(struct_processus *s_e
|
Line 2690 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 2716 instruction_wfdata(struct_processus *s_e
|
Line 2794 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 2776 instruction_wfdata(struct_processus *s_e
|
Line 2855 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 2819 instruction_wfdata(struct_processus *s_e
|
Line 2899 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 2860 instruction_wfdata(struct_processus *s_e
|
Line 2941 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 2885 instruction_wfdata(struct_processus *s_e
|
Line 2980 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 2912 instruction_wfdata(struct_processus *s_e
|
Line 3008 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 3596 instruction_wfswi(struct_processus *s_et
|
Line 3693 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 3733 instruction_wfpoke(struct_processus *s_e
|
Line 3844 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 3840 instruction_wfack(struct_processus *s_et
|
Line 3963 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 = |