From fb157491d9f019e6233db06886a74fbbd2ea9573 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 6 Jul 2008 21:14:32 +0300 Subject: [PATCH] vlc_testcancel: explicit cancellation point --- include/vlc_threads.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/vlc_threads.h b/include/vlc_threads.h index 0f25dacd6c..9610793a4a 100644 --- a/include/vlc_threads.h +++ b/include/vlc_threads.h @@ -615,6 +615,18 @@ static inline void vlc_restorecancel (int state) #endif } +/** + * Issues an explicit deferred cancellation point. + * This has no effect if thread cancellation is disabled. + * This can be called when there is a rather slow non-sleeping operation. + */ +static inline void vlc_testcancel (void) +{ +#if defined (LIBVLC_USE_PTHREAD) + pthread_testcancel (); +#endif +} + /***************************************************************************** * vlc_thread_create: create a thread *****************************************************************************/ -- 2.39.2