# HG changeset patch # User Sebastien Decugis # Date 1265707853 -32400 # Node ID ff557d8b48d799d159c8c3a2d207e44e41474d43 # Parent 3e79fef1031d70d817a1b9f8a4afbb416bf3f435 Fix deadlock in some circumstances diff -r 3e79fef1031d -r ff557d8b48d7 libfreeDiameter/log.c --- a/libfreeDiameter/log.c Tue Feb 09 18:23:07 2010 +0900 +++ b/libfreeDiameter/log.c Tue Feb 09 18:30:53 2010 +0900 @@ -49,6 +49,12 @@ int fd_breaks = 0; int fd_breakhere(void) { return ++fd_breaks; } +static void fd_cleanup_mutex_silent( void * mutex ) +{ + (void)pthread_mutex_unlock((pthread_mutex_t *)mutex); +} + + /* Log a debug message */ void fd_log_debug ( char * format, ... ) { @@ -56,7 +62,7 @@ (void)pthread_mutex_lock(&fd_log_lock); - pthread_cleanup_push(fd_cleanup_mutex, &fd_log_lock); + pthread_cleanup_push(fd_cleanup_mutex_silent, &fd_log_lock); va_start(ap, format); vfprintf( stdout, format, ap);