version 1.8, 2010/04/21 12:30:26
|
version 1.37, 2011/06/22 13:27:02
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.14 |
RPL/2 (R) version 4.1.0.prerelease.3 |
Copyright (C) 1989-2010 Dr. BERTRAND Joël |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 20
|
Line 20
|
*/ |
*/ |
|
|
|
|
#include "rpl.conv.h" |
#include "rpl-conv.h" |
|
|
|
|
/* |
/* |
Line 132 instruction_spawn(struct_processus *s_et
|
Line 132 instruction_spawn(struct_processus *s_et
|
if (recherche_variable(s_etat_processus, (*((struct_nom *) |
if (recherche_variable(s_etat_processus, (*((struct_nom *) |
(*s_objet).objet)).nom) == d_vrai) |
(*s_objet).objet)).nom) == d_vrai) |
{ |
{ |
if ((*s_etat_processus).s_liste_variables |
if ((*(*s_etat_processus).pointeur_variable_courante).objet == NULL) |
[(*s_etat_processus).position_variable_courante].objet |
|
== NULL) |
|
{ |
{ |
if (pthread_mutex_lock(&((*(*s_etat_processus) |
if (pthread_mutex_lock(&((*(*s_etat_processus) |
.s_liste_variables_partagees).mutex)) != 0) |
.s_liste_variables_partagees).mutex)) != 0) |
Line 144 instruction_spawn(struct_processus *s_et
|
Line 142 instruction_spawn(struct_processus *s_et
|
} |
} |
|
|
if (recherche_variable_partagee(s_etat_processus, |
if (recherche_variable_partagee(s_etat_processus, |
(*s_etat_processus).s_liste_variables |
(*(*s_etat_processus).pointeur_variable_courante).nom, |
[(*s_etat_processus).position_variable_courante].nom, |
(*(*s_etat_processus).pointeur_variable_courante) |
(*s_etat_processus).s_liste_variables |
.variable_partagee, (*(*s_etat_processus) |
[(*s_etat_processus).position_variable_courante] |
.pointeur_variable_courante).origine) == d_faux) |
.variable_partagee, (*s_etat_processus) |
|
.s_liste_variables[(*s_etat_processus) |
|
.position_variable_courante].origine) == d_faux) |
|
{ |
{ |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
if (pthread_mutex_unlock(&((*(*s_etat_processus) |
.s_liste_variables_partagees).mutex)) != 0) |
.s_liste_variables_partagees).mutex)) != 0) |
Line 219 instruction_spawn(struct_processus *s_et
|
Line 214 instruction_spawn(struct_processus *s_et
|
} |
} |
else |
else |
{ |
{ |
if (((*(*s_etat_processus).s_liste_variables |
if (((*(*(*s_etat_processus).pointeur_variable_courante).objet) |
[(*s_etat_processus).position_variable_courante].objet) |
.type != RPN) && ((*(*(*s_etat_processus) |
.type != RPN) && ((*(*s_etat_processus) |
.pointeur_variable_courante).objet).type != ADR)) |
.s_liste_variables[(*s_etat_processus) |
|
.position_variable_courante].objet).type != ADR)) |
|
{ |
{ |
liberation(s_etat_processus, s_objet); |
liberation(s_etat_processus, s_objet); |
|
|
Line 265 instruction_spawn(struct_processus *s_et
|
Line 258 instruction_spawn(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
|
if (sigaddset(&set, SIGFABORT) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
if (sigaddset(&set, SIGURG) != 0) |
if (sigaddset(&set, SIGURG) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
Line 342 instruction_spawn(struct_processus *s_et
|
Line 341 instruction_spawn(struct_processus *s_et
|
pthread_mutex_init(&((*s_argument_thread).mutex), &attributs_mutex); |
pthread_mutex_init(&((*s_argument_thread).mutex), &attributs_mutex); |
pthread_mutexattr_destroy(&attributs_mutex); |
pthread_mutexattr_destroy(&attributs_mutex); |
|
|
|
pthread_mutexattr_init(&attributs_mutex); |
|
pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_RECURSIVE); |
|
pthread_mutex_init(&((*s_argument_thread).mutex_nombre_references), |
|
&attributs_mutex); |
|
pthread_mutexattr_destroy(&attributs_mutex); |
|
|
(*s_argument_thread).processus_detache = d_faux; |
(*s_argument_thread).processus_detache = d_faux; |
(*s_argument_thread).thread_actif = d_faux; |
(*s_argument_thread).thread_actif = d_faux; |
(*s_argument_thread).thread_pere = pthread_self(); |
(*s_argument_thread).thread_pere = pthread_self(); |
Line 391 instruction_spawn(struct_processus *s_et
|
Line 396 instruction_spawn(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
|
# ifndef OS2 |
|
# ifndef Cygwin |
if (pthread_attr_setschedpolicy(&attributs, SCHED_OTHER) != 0) |
if (pthread_attr_setschedpolicy(&attributs, SCHED_OTHER) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
Line 408 instruction_spawn(struct_processus *s_et
|
Line 415 instruction_spawn(struct_processus *s_et
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
|
# endif |
|
# endif |
|
|
/* |
/* |
* Création de l'objet à retourner |
* Création de l'objet à retourner |
Line 453 instruction_spawn(struct_processus *s_et
|
Line 462 instruction_spawn(struct_processus *s_et
|
|
|
(*s_argument_thread).set = set; |
(*s_argument_thread).set = set; |
(*s_argument_thread).oldset = oldset; |
(*s_argument_thread).oldset = oldset; |
|
(*s_argument_thread).thread_actif = d_faux; |
|
|
if (pthread_create(&thread_id, &attributs, lancement_thread, |
if (pthread_create(&thread_id, &attributs, lancement_thread, |
s_argument_thread) != 0) |
s_argument_thread) != 0) |
Line 461 instruction_spawn(struct_processus *s_et
|
Line 471 instruction_spawn(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
|
attente.tv_sec = 0; |
|
attente.tv_nsec = GRANULARITE_us * 1000; |
|
|
|
while((*s_argument_thread).thread_actif == d_faux) |
|
{ |
|
nanosleep(&attente, NULL); |
|
INCR_GRANULARITE(attente.tv_nsec); |
|
} |
|
|
if (pthread_attr_destroy(&attributs) != 0) |
if (pthread_attr_destroy(&attributs) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
Line 480 instruction_spawn(struct_processus *s_et
|
Line 499 instruction_spawn(struct_processus *s_et
|
return; |
return; |
} |
} |
|
|
|
# ifndef OS2 |
|
# ifndef Cygwin |
if (pthread_attr_setschedpolicy(&attributs, SCHED_OTHER) != 0) |
if (pthread_attr_setschedpolicy(&attributs, SCHED_OTHER) != 0) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
Line 498 instruction_spawn(struct_processus *s_et
|
Line 519 instruction_spawn(struct_processus *s_et
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
|
# endif |
|
# endif |
|
|
// Attente de l'affectation de la grandeur processus.tid par le thread fils. |
// Attente de l'affectation de la grandeur processus.tid par le thread fils. |
|
|
Line 882 instruction_sqldisconnect(struct_process
|
Line 905 instruction_sqldisconnect(struct_process
|
"MYSQL") == 0) |
"MYSQL") == 0) |
{ |
{ |
# ifdef MYSQL_SUPPORT |
# ifdef MYSQL_SUPPORT |
|
|
if ((*((struct_connecteur_sql *) (*(*l_element_courant) |
if ((*((struct_connecteur_sql *) (*(*l_element_courant) |
.donnee).objet)).descripteur.mysql == |
.donnee).objet)).descripteur.mysql == |
(*((struct_connecteur_sql *) (*s_objet).objet)) |
(*((struct_connecteur_sql *) (*s_objet).objet)) |
Line 893 instruction_sqldisconnect(struct_process
|
Line 917 instruction_sqldisconnect(struct_process
|
{ |
{ |
drapeau = d_faux; |
drapeau = d_faux; |
} |
} |
|
|
# else |
# else |
|
|
if ((*s_etat_processus).langue == 'F') |
if ((*s_etat_processus).langue == 'F') |
Line 914 instruction_sqldisconnect(struct_process
|
Line 939 instruction_sqldisconnect(struct_process
|
.type, "POSTGRESQL") == 0) |
.type, "POSTGRESQL") == 0) |
{ |
{ |
# ifdef POSTGRESQL_SUPPORT |
# ifdef POSTGRESQL_SUPPORT |
|
|
if ((*((struct_connecteur_sql *) (*(*l_element_courant) |
if ((*((struct_connecteur_sql *) (*(*l_element_courant) |
.donnee).objet)).descripteur.postgresql == |
.donnee).objet)).descripteur.postgresql == |
(*((struct_connecteur_sql *) (*s_objet).objet)) |
(*((struct_connecteur_sql *) (*s_objet).objet)) |