--- rpl/src/instructions_s10.c 2013/05/21 12:10:12 1.74 +++ rpl/src/instructions_s10.c 2013/05/22 09:05:20 1.75 @@ -399,13 +399,27 @@ instruction_spawn(struct_processus *s_et attente.tv_sec = 0; attente.tv_nsec = GRANULARITE_us * 1000; + if (pthread_mutex_lock(&((*s_argument_thread).mutex)) != 0) + { + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + while((*s_argument_thread).thread_actif == d_faux) { scrutation_interruptions(s_etat_processus); + pthread_mutex_lock(&((*s_argument_thread).mutex)); nanosleep(&attente, NULL); + pthread_mutex_unlock(&((*s_argument_thread).mutex)); INCR_GRANULARITE(attente.tv_nsec); } + if (pthread_mutex_unlock(&((*s_argument_thread).mutex)) != 0) + { + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + if (pthread_attr_destroy(&attributs) != 0) { (*s_etat_processus).erreur_systeme = d_es_processus;