@ -218,7 +218,7 @@ lt_cleanup:
lt - > lineno [ 0 ] = lineno ;
lt - > lineno [ 0 ] = lineno ;
lt - > func [ 0 ] = func ;
lt - > func [ 0 ] = func ;
lt - > reentrancy = 0 ;
lt - > reentrancy = 0 ;
lt - > threa d[ 0 ] = 0 ;
lt - > thread_i d[ 0 ] = 0 ;
# ifdef HAVE_BKTR
# ifdef HAVE_BKTR
memset ( & lt - > backtrace [ 0 ] , 0 , sizeof ( lt - > backtrace [ 0 ] ) ) ;
memset ( & lt - > backtrace [ 0 ] , 0 , sizeof ( lt - > backtrace [ 0 ] ) ) ;
# endif
# endif
@ -322,7 +322,7 @@ int __ast_pthread_mutex_lock(const char *filename, int lineno, const char *func,
lt - > file [ lt - > reentrancy ] = filename ;
lt - > file [ lt - > reentrancy ] = filename ;
lt - > lineno [ lt - > reentrancy ] = lineno ;
lt - > lineno [ lt - > reentrancy ] = lineno ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > threa d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > thread_i d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > reentrancy + + ;
lt - > reentrancy + + ;
} else {
} else {
__ast_mutex_logger ( " %s line %d (%s): '%s' really deep reentrancy! \n " ,
__ast_mutex_logger ( " %s line %d (%s): '%s' really deep reentrancy! \n " ,
@ -402,7 +402,7 @@ int __ast_pthread_mutex_trylock(const char *filename, int lineno, const char *fu
lt - > file [ lt - > reentrancy ] = filename ;
lt - > file [ lt - > reentrancy ] = filename ;
lt - > lineno [ lt - > reentrancy ] = lineno ;
lt - > lineno [ lt - > reentrancy ] = lineno ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > threa d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > thread_i d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > reentrancy + + ;
lt - > reentrancy + + ;
} else {
} else {
__ast_mutex_logger ( " %s line %d (%s): '%s' really deep reentrancy! \n " ,
__ast_mutex_logger ( " %s line %d (%s): '%s' really deep reentrancy! \n " ,
@ -445,7 +445,7 @@ int __ast_pthread_mutex_unlock(const char *filename, int lineno, const char *fun
if ( lt ) {
if ( lt ) {
ast_reentrancy_lock ( lt ) ;
ast_reentrancy_lock ( lt ) ;
if ( lt - > reentrancy & & ( lt - > threa d[ ROFFSET ] ! = pthread_self ( ) ) ) {
if ( lt - > reentrancy & & ( lt - > thread_i d[ ROFFSET ] ! = pthread_self ( ) ) ) {
__ast_mutex_logger ( " %s line %d (%s): attempted unlock mutex '%s' without owning it! \n " ,
__ast_mutex_logger ( " %s line %d (%s): attempted unlock mutex '%s' without owning it! \n " ,
filename , lineno , func , mutex_name ) ;
filename , lineno , func , mutex_name ) ;
__ast_mutex_logger ( " %s line %d (%s): '%s' was locked here. \n " ,
__ast_mutex_logger ( " %s line %d (%s): '%s' was locked here. \n " ,
@ -466,7 +466,7 @@ int __ast_pthread_mutex_unlock(const char *filename, int lineno, const char *fun
lt - > file [ lt - > reentrancy ] = NULL ;
lt - > file [ lt - > reentrancy ] = NULL ;
lt - > lineno [ lt - > reentrancy ] = 0 ;
lt - > lineno [ lt - > reentrancy ] = 0 ;
lt - > func [ lt - > reentrancy ] = NULL ;
lt - > func [ lt - > reentrancy ] = NULL ;
lt - > threa d[ lt - > reentrancy ] = 0 ;
lt - > thread_i d[ lt - > reentrancy ] = 0 ;
}
}
# ifdef HAVE_BKTR
# ifdef HAVE_BKTR
@ -536,7 +536,7 @@ static void restore_lock_tracking(struct ast_lock_track *lt, struct ast_lock_tra
memcpy ( lt - > lineno , lt_saved - > lineno , sizeof ( lt - > lineno ) ) ;
memcpy ( lt - > lineno , lt_saved - > lineno , sizeof ( lt - > lineno ) ) ;
lt - > reentrancy = lt_saved - > reentrancy ;
lt - > reentrancy = lt_saved - > reentrancy ;
memcpy ( lt - > func , lt_saved - > func , sizeof ( lt - > func ) ) ;
memcpy ( lt - > func , lt_saved - > func , sizeof ( lt - > func ) ) ;
memcpy ( lt - > thread , lt_saved - > thread , sizeof ( lt - > threa d) ) ;
memcpy ( lt - > thread_id , lt_saved - > thread_id , sizeof ( lt - > thread_i d) ) ;
# ifdef HAVE_BKTR
# ifdef HAVE_BKTR
memcpy ( lt - > backtrace , lt_saved - > backtrace , sizeof ( lt - > backtrace ) ) ;
memcpy ( lt - > backtrace , lt_saved - > backtrace , sizeof ( lt - > backtrace ) ) ;
# endif
# endif
@ -571,7 +571,7 @@ int __ast_cond_wait(const char *filename, int lineno, const char *func,
if ( lt ) {
if ( lt ) {
ast_reentrancy_lock ( lt ) ;
ast_reentrancy_lock ( lt ) ;
if ( lt - > reentrancy & & ( lt - > threa d[ ROFFSET ] ! = pthread_self ( ) ) ) {
if ( lt - > reentrancy & & ( lt - > thread_i d[ ROFFSET ] ! = pthread_self ( ) ) ) {
__ast_mutex_logger ( " %s line %d (%s): attempted wait using mutex '%s' without owning it! \n " ,
__ast_mutex_logger ( " %s line %d (%s): attempted wait using mutex '%s' without owning it! \n " ,
filename , lineno , func , mutex_name ) ;
filename , lineno , func , mutex_name ) ;
__ast_mutex_logger ( " %s line %d (%s): '%s' was locked here. \n " ,
__ast_mutex_logger ( " %s line %d (%s): '%s' was locked here. \n " ,
@ -639,7 +639,7 @@ int __ast_cond_timedwait(const char *filename, int lineno, const char *func,
if ( lt ) {
if ( lt ) {
ast_reentrancy_lock ( lt ) ;
ast_reentrancy_lock ( lt ) ;
if ( lt - > reentrancy & & ( lt - > threa d[ ROFFSET ] ! = pthread_self ( ) ) ) {
if ( lt - > reentrancy & & ( lt - > thread_i d[ ROFFSET ] ! = pthread_self ( ) ) ) {
__ast_mutex_logger ( " %s line %d (%s): attempted wait using mutex '%s' without owning it! \n " ,
__ast_mutex_logger ( " %s line %d (%s): attempted wait using mutex '%s' without owning it! \n " ,
filename , lineno , func , mutex_name ) ;
filename , lineno , func , mutex_name ) ;
__ast_mutex_logger ( " %s line %d (%s): '%s' was locked here. \n " ,
__ast_mutex_logger ( " %s line %d (%s): '%s' was locked here. \n " ,
@ -747,7 +747,7 @@ lt_cleanup:
lt - > lineno [ 0 ] = lineno ;
lt - > lineno [ 0 ] = lineno ;
lt - > func [ 0 ] = func ;
lt - > func [ 0 ] = func ;
lt - > reentrancy = 0 ;
lt - > reentrancy = 0 ;
lt - > threa d[ 0 ] = 0 ;
lt - > thread_i d[ 0 ] = 0 ;
# ifdef HAVE_BKTR
# ifdef HAVE_BKTR
memset ( & lt - > backtrace [ 0 ] , 0 , sizeof ( lt - > backtrace [ 0 ] ) ) ;
memset ( & lt - > backtrace [ 0 ] , 0 , sizeof ( lt - > backtrace [ 0 ] ) ) ;
# endif
# endif
@ -790,13 +790,13 @@ int __ast_rwlock_unlock(const char *filename, int line, const char *func, ast_rw
int i ;
int i ;
pthread_t self = pthread_self ( ) ;
pthread_t self = pthread_self ( ) ;
for ( i = lt - > reentrancy - 1 ; i > = 0 ; - - i ) {
for ( i = lt - > reentrancy - 1 ; i > = 0 ; - - i ) {
if ( lt - > threa d[ i ] = = self ) {
if ( lt - > thread_i d[ i ] = = self ) {
lock_found = 1 ;
lock_found = 1 ;
if ( i ! = lt - > reentrancy - 1 ) {
if ( i ! = lt - > reentrancy - 1 ) {
lt - > file [ i ] = lt - > file [ lt - > reentrancy - 1 ] ;
lt - > file [ i ] = lt - > file [ lt - > reentrancy - 1 ] ;
lt - > lineno [ i ] = lt - > lineno [ lt - > reentrancy - 1 ] ;
lt - > lineno [ i ] = lt - > lineno [ lt - > reentrancy - 1 ] ;
lt - > func [ i ] = lt - > func [ lt - > reentrancy - 1 ] ;
lt - > func [ i ] = lt - > func [ lt - > reentrancy - 1 ] ;
lt - > thread [ i ] = lt - > threa d[ lt - > reentrancy - 1 ] ;
lt - > thread_id [ i ] = lt - > thread_i d[ lt - > reentrancy - 1 ] ;
}
}
# ifdef HAVE_BKTR
# ifdef HAVE_BKTR
bt = & lt - > backtrace [ i ] ;
bt = & lt - > backtrace [ i ] ;
@ -804,7 +804,7 @@ int __ast_rwlock_unlock(const char *filename, int line, const char *func, ast_rw
lt - > file [ lt - > reentrancy - 1 ] = NULL ;
lt - > file [ lt - > reentrancy - 1 ] = NULL ;
lt - > lineno [ lt - > reentrancy - 1 ] = 0 ;
lt - > lineno [ lt - > reentrancy - 1 ] = 0 ;
lt - > func [ lt - > reentrancy - 1 ] = NULL ;
lt - > func [ lt - > reentrancy - 1 ] = NULL ;
lt - > threa d[ lt - > reentrancy - 1 ] = AST_PTHREADT_NULL ;
lt - > thread_i d[ lt - > reentrancy - 1 ] = AST_PTHREADT_NULL ;
break ;
break ;
}
}
}
}
@ -918,7 +918,7 @@ int __ast_rwlock_rdlock(const char *filename, int line, const char *func, ast_rw
lt - > file [ lt - > reentrancy ] = filename ;
lt - > file [ lt - > reentrancy ] = filename ;
lt - > lineno [ lt - > reentrancy ] = line ;
lt - > lineno [ lt - > reentrancy ] = line ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > threa d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > thread_i d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > reentrancy + + ;
lt - > reentrancy + + ;
}
}
ast_reentrancy_unlock ( lt ) ;
ast_reentrancy_unlock ( lt ) ;
@ -1027,7 +1027,7 @@ int __ast_rwlock_wrlock(const char *filename, int line, const char *func, ast_rw
lt - > file [ lt - > reentrancy ] = filename ;
lt - > file [ lt - > reentrancy ] = filename ;
lt - > lineno [ lt - > reentrancy ] = line ;
lt - > lineno [ lt - > reentrancy ] = line ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > threa d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > thread_i d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > reentrancy + + ;
lt - > reentrancy + + ;
}
}
ast_reentrancy_unlock ( lt ) ;
ast_reentrancy_unlock ( lt ) ;
@ -1120,7 +1120,7 @@ int __ast_rwlock_timedrdlock(const char *filename, int line, const char *func, a
lt - > file [ lt - > reentrancy ] = filename ;
lt - > file [ lt - > reentrancy ] = filename ;
lt - > lineno [ lt - > reentrancy ] = line ;
lt - > lineno [ lt - > reentrancy ] = line ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > threa d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > thread_i d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > reentrancy + + ;
lt - > reentrancy + + ;
}
}
ast_reentrancy_unlock ( lt ) ;
ast_reentrancy_unlock ( lt ) ;
@ -1213,7 +1213,7 @@ int __ast_rwlock_timedwrlock(const char *filename, int line, const char *func, a
lt - > file [ lt - > reentrancy ] = filename ;
lt - > file [ lt - > reentrancy ] = filename ;
lt - > lineno [ lt - > reentrancy ] = line ;
lt - > lineno [ lt - > reentrancy ] = line ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > threa d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > thread_i d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > reentrancy + + ;
lt - > reentrancy + + ;
}
}
ast_reentrancy_unlock ( lt ) ;
ast_reentrancy_unlock ( lt ) ;
@ -1288,7 +1288,7 @@ int __ast_rwlock_tryrdlock(const char *filename, int line, const char *func, ast
lt - > file [ lt - > reentrancy ] = filename ;
lt - > file [ lt - > reentrancy ] = filename ;
lt - > lineno [ lt - > reentrancy ] = line ;
lt - > lineno [ lt - > reentrancy ] = line ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > threa d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > thread_i d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > reentrancy + + ;
lt - > reentrancy + + ;
}
}
ast_reentrancy_unlock ( lt ) ;
ast_reentrancy_unlock ( lt ) ;
@ -1347,7 +1347,7 @@ int __ast_rwlock_trywrlock(const char *filename, int line, const char *func, ast
lt - > file [ lt - > reentrancy ] = filename ;
lt - > file [ lt - > reentrancy ] = filename ;
lt - > lineno [ lt - > reentrancy ] = line ;
lt - > lineno [ lt - > reentrancy ] = line ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > func [ lt - > reentrancy ] = func ;
lt - > threa d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > thread_i d[ lt - > reentrancy ] = pthread_self ( ) ;
lt - > reentrancy + + ;
lt - > reentrancy + + ;
}
}
ast_reentrancy_unlock ( lt ) ;
ast_reentrancy_unlock ( lt ) ;