--- rpl/src/instructions_s10.c 2011/09/26 15:57:15 1.49 +++ rpl/src/instructions_s10.c 2012/04/13 14:12:59 1.57 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.4 - Copyright (C) 1989-2011 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.8 + Copyright (C) 1989-2012 Dr. BERTRAND Joël This file is part of RPL/2. @@ -45,7 +45,6 @@ instruction_spawn(struct_processus *s_et pthread_mutexattr_t attributs_mutex; - pthread_t thread_id; pthread_t thread_surveillance; struct_descripteur_thread *s_argument_thread; @@ -353,27 +352,29 @@ instruction_spawn(struct_processus *s_et return; } -# ifndef OS2 -# ifndef Cygwin +# ifdef SCHED_OTHER if (pthread_attr_setschedpolicy(&attributs, SCHED_OTHER) != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; return; } +# endif +# ifdef PTHREAD_EXPLICIT_SCHED if (pthread_attr_setinheritsched(&attributs, PTHREAD_EXPLICIT_SCHED) != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; return; } +# endif +# ifdef PTHREAD_SCOPE_SYSTEM if (pthread_attr_setscope(&attributs, PTHREAD_SCOPE_SYSTEM) != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; return; } # endif -# endif /* * Création de l'objet à retourner @@ -413,8 +414,8 @@ instruction_spawn(struct_processus *s_et (*s_argument_thread).thread_actif = d_faux; - if (pthread_create(&thread_id, &attributs, lancement_thread, - s_argument_thread) != 0) + if (pthread_create(&(*s_nouvel_etat_processus).tid, + &attributs, lancement_thread, s_argument_thread) != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; return; @@ -449,28 +450,30 @@ instruction_spawn(struct_processus *s_et return; } -# ifndef OS2 -# ifndef Cygwin +# ifdef SCHED_OTHER if (pthread_attr_setschedpolicy(&attributs, SCHED_OTHER) != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; return; } +# endif +# ifdef PTHREAD_EXPLICIT_SCHED if (pthread_attr_setinheritsched(&attributs, PTHREAD_EXPLICIT_SCHED) != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; return; } +# endif +# ifdef PTHREAD_SCOPE_SYSTEM if (pthread_attr_setscope(&attributs, PTHREAD_SCOPE_SYSTEM) != 0) { (*s_etat_processus).erreur_systeme = d_es_processus; return; } # endif -# endif /* * On copie l'objet plutôt que le pointeur car cet objet peut être @@ -703,10 +706,18 @@ instruction_sqlconnect(struct_processus if ((s_objet_resultat = parametres_sql(s_etat_processus, s_objet_argument)) == NULL) { + liberation(s_etat_processus, s_objet_resultat); liberation(s_etat_processus, s_objet_argument); return; } + if ((*s_etat_processus).erreur_execution == + d_ex_instruction_indisponible) + { + liberation(s_etat_processus, s_objet_resultat); + return; + } + if ((s_objet_systeme = copie_objet(s_etat_processus, s_objet_resultat, 'O')) == NULL) {