+#endif
+
+#if defined( WIN32 ) && !defined ETIMEDOUT
+# define ETIMEDOUT 10060 /* This is the value in winsock.h. */
+#endif
+
+/*****************************************************************************
+ * Function definitions
+ *****************************************************************************/
+VLC_EXPORT( int, vlc_mutex_init, ( vlc_mutex_t * ) );
+VLC_EXPORT( int, vlc_mutex_init_recursive, ( vlc_mutex_t * ) );
+VLC_EXPORT( void, vlc_mutex_destroy, ( vlc_mutex_t * ) );
+VLC_EXPORT( void, vlc_mutex_lock, ( vlc_mutex_t * ) );
+VLC_EXPORT( void, vlc_mutex_unlock, ( vlc_mutex_t * ) );
+VLC_EXPORT( int, vlc_cond_init, ( vlc_cond_t * ) );
+VLC_EXPORT( void, vlc_cond_destroy, ( vlc_cond_t * ) );
+VLC_EXPORT( void, vlc_cond_signal, (vlc_cond_t *) );
+VLC_EXPORT( void, vlc_cond_broadcast, (vlc_cond_t *) );
+VLC_EXPORT( void, vlc_cond_wait, (vlc_cond_t *, vlc_mutex_t *) );
+VLC_EXPORT( int, vlc_cond_timedwait, (vlc_cond_t *, vlc_mutex_t *, mtime_t) );
+VLC_EXPORT( int, vlc_threadvar_create, (vlc_threadvar_t * , void (*) (void *) ) );
+VLC_EXPORT( void, vlc_threadvar_delete, (vlc_threadvar_t *) );
+VLC_EXPORT( int, __vlc_thread_create, ( vlc_object_t *, const char *, int, const char *, void * ( * ) ( vlc_object_t * ), int, bool ) );
+VLC_EXPORT( int, __vlc_thread_set_priority, ( vlc_object_t *, const char *, int, int ) );
+VLC_EXPORT( void, __vlc_thread_join, ( vlc_object_t * ) );
+
+VLC_EXPORT( int, vlc_clone, (vlc_thread_t *, void * (*) (void *), void *, int) );
+VLC_EXPORT( void, vlc_cancel, (vlc_thread_t) );
+VLC_EXPORT( void, vlc_join, (vlc_thread_t, void **) );
+VLC_EXPORT (void, vlc_control_cancel, (int cmd, ...));
+
+#ifndef LIBVLC_USE_PTHREAD_CANCEL
+enum {
+ VLC_SAVE_CANCEL,
+ VLC_RESTORE_CANCEL,
+ VLC_TEST_CANCEL,
+ VLC_DO_CANCEL,
+ VLC_CLEANUP_PUSH,
+ VLC_CLEANUP_POP,
+};
+#endif
+
+#define vlc_thread_ready vlc_object_signal
+
+/**
+ * Save the cancellation state and disable cancellation for the calling thread.
+ * This function must be called before entering a piece of code that is not
+ * cancellation-safe.
+ * @return Previous cancellation state (opaque value).
+ */
+static inline int vlc_savecancel (void)