]> git.sesse.net Git - vlc/commitdiff
vlc_testcancel: explicit cancellation point
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 6 Jul 2008 18:14:32 +0000 (21:14 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 27 Aug 2008 19:43:03 +0000 (22:43 +0300)
include/vlc_threads.h

index 0f25dacd6caa7f7cb30e1d275f281d56e11de13e..9610793a4a1ac4d53ec617a9237769e2e5738129 100644 (file)
@@ -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
  *****************************************************************************/