Commit 68bbddd3 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

include: add VLC_THREAD_CANCELED constant macro

This is the return value of a thread that has terminated due to
cancelation.
parent 801448cc
...@@ -53,6 +53,7 @@ VLC_API void vlc_testcancel(void); ...@@ -53,6 +53,7 @@ VLC_API void vlc_testcancel(void);
# endif # endif
typedef struct vlc_thread *vlc_thread_t; typedef struct vlc_thread *vlc_thread_t;
#define VLC_THREAD_CANCELED NULL
typedef struct typedef struct
{ {
bool dynamic; bool dynamic;
...@@ -102,6 +103,7 @@ static inline int vlc_poll(struct pollfd *fds, unsigned nfds, int timeout) ...@@ -102,6 +103,7 @@ static inline int vlc_poll(struct pollfd *fds, unsigned nfds, int timeout)
# include <errno.h> # include <errno.h>
typedef struct vlc_thread *vlc_thread_t; typedef struct vlc_thread *vlc_thread_t;
#define VLC_THREAD_CANCELED NULL
typedef struct typedef struct
{ {
bool dynamic; bool dynamic;
...@@ -170,6 +172,7 @@ static inline int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout) ...@@ -170,6 +172,7 @@ static inline int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
# define LIBVLC_NEED_RWLOCK # define LIBVLC_NEED_RWLOCK
typedef struct vlc_thread *vlc_thread_t; typedef struct vlc_thread *vlc_thread_t;
#define VLC_THREAD_CANCELED NULL
typedef pthread_mutex_t vlc_mutex_t; typedef pthread_mutex_t vlc_mutex_t;
#define VLC_STATIC_MUTEX PTHREAD_MUTEX_INITIALIZER #define VLC_STATIC_MUTEX PTHREAD_MUTEX_INITIALIZER
...@@ -221,6 +224,7 @@ static inline int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout) ...@@ -221,6 +224,7 @@ static inline int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
# define LIBVLC_USE_PTHREAD_CLEANUP 1 # define LIBVLC_USE_PTHREAD_CLEANUP 1
typedef pthread_t vlc_thread_t; typedef pthread_t vlc_thread_t;
#define VLC_THREAD_CANCELED PTHREAD_CANCELED
typedef pthread_mutex_t vlc_mutex_t; typedef pthread_mutex_t vlc_mutex_t;
#define VLC_STATIC_MUTEX PTHREAD_MUTEX_INITIALIZER #define VLC_STATIC_MUTEX PTHREAD_MUTEX_INITIALIZER
typedef struct typedef struct
...@@ -262,6 +266,11 @@ typedef struct vlc_timer *vlc_timer_t; ...@@ -262,6 +266,11 @@ typedef struct vlc_timer *vlc_timer_t;
*/ */
typedef pthread_t vlc_thread_t; typedef pthread_t vlc_thread_t;
/**
* Return value of a canceled thread.
*/
#define VLC_THREAD_CANCELED PTHREAD_CANCELED
/** /**
* Mutex. * Mutex.
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment