[vlc-devel] commit: vlc_thread_fatal: disable thread cancellation ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Oct 20 22:38:16 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Oct 20 23:37:36 2009 +0300| [16f5c8b85a53a250b6f7f397175243a86d868078] | committer: Rémi Denis-Courmont 

vlc_thread_fatal: disable thread cancellation

It shouldn't matter much when we get to such a sorry code path, but
better safe than sorry.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=16f5c8b85a53a250b6f7f397175243a86d868078
---

 src/misc/pthread.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/misc/pthread.c b/src/misc/pthread.c
index ce604f4..1379163 100644
--- a/src/misc/pthread.c
+++ b/src/misc/pthread.c
@@ -89,6 +89,7 @@ static void
 vlc_thread_fatal (const char *action, int error,
                   const char *function, const char *file, unsigned line)
 {
+    int canc = vlc_savecancel ();
     fprintf (stderr, "LibVLC fatal error %s (%d) in thread %lu ",
              action, error, vlc_threadid ());
     vlc_trace (function, file, line);
@@ -119,6 +120,7 @@ vlc_thread_fatal (const char *action, int error,
 #endif
     fflush (stderr);
 
+    vlc_restorecancel (canc);
     abort ();
 }
 




More information about the vlc-devel mailing list