Commit a29c97bd authored by Sebastien Decugis's avatar Sebastien Decugis
Browse files

Fix deadlock in some circumstances

parent 3c69256a
......@@ -49,6 +49,12 @@ char * fd_debug_one_file = NULL;
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 fd_log_debug ( char * format, ... )
(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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment