VLC_EXPORT( void, __vlc_thread_join, ( vlc_object_t *, const char *, int ) );
VLC_EXPORT( int, vlc_clone, (vlc_thread_t *, void * (*) (void *), void *, int) );
+VLC_EXPORT( void, vlc_cancel, (vlc_thread_t) );
VLC_EXPORT( int, vlc_join, (vlc_thread_t, void **) );
#define vlc_thread_ready vlc_object_signal
return ret;
}
+/**
+ * Marks a thread as cancelled. Next time the target thread reaches a
+ * cancellation point (while not having disabled cancellation), it will
+ * run its cancellation cleanup handler, the thread variable destructors, and
+ * terminate. vlc_join() must be used afterward regardless of a thread being
+ * cancelled or not.
+ */
+void vlc_cancel (vlc_thread_t thread_id)
+{
+#if defined (LIBVLC_USE_PTHREAD)
+ pthread_cancel (thread_id);
+#endif
+}
+
/**
* Waits for a thread to complete (if needed), and destroys it.
* @param handle thread handle
p_priv->b_thread = false;
}
+