]> git.sesse.net Git - vlc/commitdiff
More natural prototype for vlc_savecancel
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 5 Aug 2008 18:44:47 +0000 (21:44 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 27 Aug 2008 19:43:04 +0000 (22:43 +0300)
include/vlc_threads.h

index c2dd3030a8719f1ba729254afab68c6097eff1dc..8796d6ccae31beb21e151eecf5dc304855218943 100644 (file)
@@ -603,16 +603,17 @@ VLC_EXPORT (void, vlc_control_cancel, (int cmd, ...));
  * 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.
- * @param p_state storage for the previous cancellation state
- * @return Nothing, always succeeds.
+ * @return Previous cancellation state (opaque value).
  */
-static inline void vlc_savecancel (int *p_state)
+static inline int vlc_savecancel (void)
 {
+    int state;
 #if defined (LIBVLC_USE_PTHREAD)
-    (void) pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, p_state);
+    (void) pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state);
 #else
-    vlc_control_cancel (VLC_SAVE_CANCEL, p_state);
+    vlc_control_cancel (VLC_SAVE_CANCEL, &state);
 #endif
+    return state;
 }
 
 /**