]> git.sesse.net Git - vlc/commitdiff
logger: disable thread cancellation in callback
authorRafaël Carré <rafael.carre@gmail.com>
Wed, 30 Sep 2009 16:21:02 +0000 (18:21 +0200)
committerRafaël Carré <rafael.carre@gmail.com>
Wed, 30 Sep 2009 16:21:50 +0000 (18:21 +0200)
fix a deadlock where the thread would be cancelled while still holding
message bank lock

modules/misc/logger.c

index 30b69efcaf552a9b8a4f60eed705787552268012..9a7e1bc2fd717b316a1751aaf02f1ca5f0f7d283 100644 (file)
@@ -374,6 +374,8 @@ static void Overflow (msg_cb_data_t *p_sys, msg_item_t *p_item, unsigned overrun
     if (verbosity < priority)
         return;
 
+    int canc = vlc_savecancel();
+
     switch( p_sys->i_mode )
     {
         case MODE_HTML:
@@ -389,6 +391,8 @@ static void Overflow (msg_cb_data_t *p_sys, msg_item_t *p_item, unsigned overrun
             TextPrint( p_item, p_sys->p_file );
             break;
     }
+
+    vlc_restorecancel( canc );
 }
 
 static const char ppsz_type[4][11] = {