--- rpl/src/instructions_s10.c 2013/05/22 09:05:20 1.75 +++ rpl/src/instructions_s10.c 2013/05/22 13:40:12 1.76 @@ -408,9 +408,21 @@ instruction_spawn(struct_processus *s_et while((*s_argument_thread).thread_actif == d_faux) { scrutation_interruptions(s_etat_processus); - pthread_mutex_lock(&((*s_argument_thread).mutex)); + + if (pthread_mutex_unlock(&((*s_argument_thread).mutex)) != 0) + { + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + nanosleep(&attente, NULL); - pthread_mutex_unlock(&((*s_argument_thread).mutex)); + + if (pthread_mutex_lock(&((*s_argument_thread).mutex)) != 0) + { + (*s_etat_processus).erreur_systeme = d_es_processus; + return; + } + INCR_GRANULARITE(attente.tv_nsec); }