version 1.12, 2010/05/25 18:09:44
|
version 1.30.2.1, 2011/04/11 13:02:25
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.16 |
RPL/2 (R) version 4.0.22 |
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 348 instruction_spawn(struct_processus *s_et
|
Line 348 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 397 instruction_spawn(struct_processus *s_et
|
Line 403 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 414 instruction_spawn(struct_processus *s_et
|
Line 422 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 459 instruction_spawn(struct_processus *s_et
|
Line 469 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; |
# ifdef DEBUG_MEMOIRE |
|
debug_memoire_verrouillage(); |
|
# endif |
|
|
|
if (pthread_create(&thread_id, &attributs, lancement_thread, |
if (pthread_create(&thread_id, &attributs, lancement_thread, |
s_argument_thread) != 0) |
s_argument_thread) != 0) |
{ |
{ |
# ifdef DEBUG_MEMOIRE |
|
debug_memoire_deverrouillage(); |
|
# endif |
|
|
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
|
|
# ifdef DEBUG_MEMOIRE |
attente.tv_sec = 0; |
debug_memoire_deverrouillage(); |
attente.tv_nsec = GRANULARITE_us * 1000; |
# endif |
|
|
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) |
{ |
{ |
Line 498 instruction_spawn(struct_processus *s_et
|
Line 506 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 516 instruction_spawn(struct_processus *s_et
|
Line 526 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 660 instruction_spawn(struct_processus *s_et
|
Line 672 instruction_spawn(struct_processus *s_et
|
|
|
// Lancement du thread de surveillance |
// Lancement du thread de surveillance |
|
|
# ifdef DEBUG_MEMOIRE |
|
debug_memoire_verrouillage(); |
|
# endif |
|
|
|
if (pthread_create(&thread_surveillance, &attributs, |
if (pthread_create(&thread_surveillance, &attributs, |
surveillance_processus, s_argument_thread) != 0) |
surveillance_processus, s_argument_thread) != 0) |
{ |
{ |
# ifdef DEBUG_MEMOIRE |
|
debug_memoire_deverrouillage(); |
|
# endif |
|
|
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
|
|
# ifdef DEBUG_MEMOIRE |
|
debug_memoire_deverrouillage(); |
|
# endif |
|
|
|
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 912 instruction_sqldisconnect(struct_process
|
Line 912 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 923 instruction_sqldisconnect(struct_process
|
Line 924 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 944 instruction_sqldisconnect(struct_process
|
Line 946 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)) |