Commit 12d0d264 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

More natural prototype for vlc_savecancel

parent 5a631288
...@@ -603,16 +603,17 @@ VLC_EXPORT (void, vlc_control_cancel, (int cmd, ...)); ...@@ -603,16 +603,17 @@ VLC_EXPORT (void, vlc_control_cancel, (int cmd, ...));
* Save the cancellation state and disable cancellation for the calling thread. * 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 * This function must be called before entering a piece of code that is not
* cancellation-safe. * cancellation-safe.
* @param p_state storage for the previous cancellation state * @return Previous cancellation state (opaque value).
* @return Nothing, always succeeds.
*/ */
static inline void vlc_savecancel (int *p_state) static inline int vlc_savecancel (void)
{ {
int state;
#if defined (LIBVLC_USE_PTHREAD) #if defined (LIBVLC_USE_PTHREAD)
(void) pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, p_state); (void) pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
#else #else
vlc_control_cancel (VLC_SAVE_CANCEL, p_state); vlc_control_cancel (VLC_SAVE_CANCEL, &state);
#endif #endif
return state;
} }
/** /**
......
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