From: RĂ©mi Denis-Courmont Date: Sun, 6 Jul 2008 18:14:32 +0000 (+0300) Subject: vlc_testcancel: explicit cancellation point X-Git-Tag: 1.0.0-pre1~3775 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=fb157491d9f019e6233db06886a74fbbd2ea9573;p=vlc vlc_testcancel: explicit cancellation point --- 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 *****************************************************************************/