[vlc-devel] commit: More natural prototype for vlc_savecancel ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Aug 27 22:57:27 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Tue Aug  5 21:44:47 2008 +0300| [12d0d264c41ad48bc55f91bb32ab8b64fe1d268d] | committer: Rémi Denis-Courmont 

More natural prototype for vlc_savecancel

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=12d0d264c41ad48bc55f91bb32ab8b64fe1d268d
---

 include/vlc_threads.h |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index c2dd303..8796d6c 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -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;
 }
 
 /**




More information about the vlc-devel mailing list