version 1.24, 2010/06/08 10:22:36
|
version 1.27, 2010/06/18 11:54:00
|
Line 1110 liberation(struct_processus *s_etat_proc
|
Line 1110 liberation(struct_processus *s_etat_proc
|
|
|
case PRC : |
case PRC : |
{ |
{ |
if (pthread_mutex_lock(&((*s_etat_processus).mutex)) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
if (pthread_mutex_lock(&((*(*((struct_processus_fils *) |
if (pthread_mutex_lock(&((*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).mutex)) != 0) |
(*s_objet).objet)).thread).mutex)) != 0) |
{ |
{ |
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
Line 1152 liberation(struct_processus *s_etat_proc
|
Line 1140 liberation(struct_processus *s_etat_proc
|
if (pthread_mutex_unlock(&((*(*((struct_processus_fils *) |
if (pthread_mutex_unlock(&((*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).mutex)) != 0) |
(*s_objet).objet)).thread).mutex)) != 0) |
{ |
{ |
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
(*s_etat_processus).erreur_systeme = d_es_processus; |
return; |
return; |
} |
} |
Line 1169 liberation(struct_processus *s_etat_proc
|
Line 1151 liberation(struct_processus *s_etat_proc
|
free((*((struct_processus_fils *) (*s_objet).objet)).thread); |
free((*((struct_processus_fils *) (*s_objet).objet)).thread); |
} |
} |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
|
{ |
|
(*s_etat_processus).erreur_systeme = d_es_processus; |
|
return; |
|
} |
|
|
|
if (decrementation_atomique(s_objet) > 0) |
if (decrementation_atomique(s_objet) > 0) |
{ |
{ |
return; |
return; |
Line 2264 copie_objet(struct_processus *s_etat_pro
|
Line 2240 copie_objet(struct_processus *s_etat_pro
|
|
|
case PRC : |
case PRC : |
{ |
{ |
if (pthread_mutex_lock(&((*s_etat_processus).mutex)) != 0) |
|
{ |
|
return(NULL); |
|
} |
|
|
|
if (pthread_mutex_lock(&((*(*((struct_processus_fils *) |
if (pthread_mutex_lock(&((*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).mutex)) != 0) |
(*s_objet).objet)).thread).mutex)) != 0) |
{ |
{ |
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
|
{ |
|
return(NULL); |
|
} |
|
|
|
return(NULL); |
return(NULL); |
} |
} |
|
|
Line 2286 copie_objet(struct_processus *s_etat_pro
|
Line 2252 copie_objet(struct_processus *s_etat_pro
|
if (pthread_mutex_unlock(&((*(*((struct_processus_fils *) |
if (pthread_mutex_unlock(&((*(*((struct_processus_fils *) |
(*s_objet).objet)).thread).mutex)) != 0) |
(*s_objet).objet)).thread).mutex)) != 0) |
{ |
{ |
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
|
{ |
|
return(NULL); |
|
} |
|
|
|
return(NULL); |
return(NULL); |
} |
} |
|
|
if (type != 'O') |
if (type != 'O') |
{ |
{ |
incrementation_atomique(s_objet); |
incrementation_atomique(s_objet); |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
|
{ |
|
return(NULL); |
|
} |
|
|
|
return(s_objet); |
return(s_objet); |
} |
} |
|
|
if ((s_nouvel_objet = allocation(s_etat_processus, PRC)) == NULL) |
if ((s_nouvel_objet = allocation(s_etat_processus, PRC)) == NULL) |
{ |
{ |
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
|
{ |
|
return(NULL); |
|
} |
|
|
|
return(NULL); |
return(NULL); |
} |
} |
|
|
(*((struct_processus_fils *) (*s_nouvel_objet).objet)) = |
(*((struct_processus_fils *) (*s_nouvel_objet).objet)) = |
(*((struct_processus_fils *) (*s_objet).objet)); |
(*((struct_processus_fils *) (*s_objet).objet)); |
|
|
if (pthread_mutex_unlock(&((*s_etat_processus).mutex)) != 0) |
|
{ |
|
return(NULL); |
|
} |
|
|
|
break; |
break; |
} |
} |
|
|
Line 3771 debug_memoire_modification(void *pointeu
|
Line 3716 debug_memoire_modification(void *pointeu
|
{ |
{ |
pthread_mutex_unlock(&mutex_allocation); |
pthread_mutex_unlock(&mutex_allocation); |
|
|
uprintf("[%d-%llu] ILLEGAL POINTER\n", |
uprintf("[%d-%llu] ILLEGAL POINTER (realloc)\n", |
getpid(), (unsigned long long) pthread_self()); |
getpid(), (unsigned long long) pthread_self()); |
# ifdef __BACKTRACE |
# ifdef __BACKTRACE |
BACKTRACE(PROFONDEUR_PILE); |
BACKTRACE(PROFONDEUR_PILE); |
Line 3868 debug_memoire_retrait(void *pointeur)
|
Line 3813 debug_memoire_retrait(void *pointeur)
|
|
|
if (element_courant == NULL) |
if (element_courant == NULL) |
{ |
{ |
uprintf("[%d-%llu] ILLEGAL POINTER\n", |
uprintf("[%d-%llu] ILLEGAL POINTER (free)\n", |
getpid(), (unsigned long long) pthread_self()); |
getpid(), (unsigned long long) pthread_self()); |
# ifdef __BACKTRACE |
# ifdef __BACKTRACE |
BACKTRACE(PROFONDEUR_PILE); |
BACKTRACE(PROFONDEUR_PILE); |