[vlc-commits] threads: remove cancellation from vlc_rwlock_t

Rémi Denis-Courmont git at videolan.org
Fri Apr 17 18:51:20 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Apr 14 22:35:16 2020 +0300| [1a057c6c6fd3092632a6ad3a5c64ef7eb0737b42] | committer: Rémi Denis-Courmont

threads: remove cancellation from vlc_rwlock_t

This was never used.

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

 include/vlc_threads.h | 2 --
 src/misc/threads.c    | 6 ------
 2 files changed, 8 deletions(-)

diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index b1b35c3851..d0e3d1c10c 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -568,13 +568,11 @@ VLC_API void vlc_rwlock_destroy(vlc_rwlock_t *);
  * Acquires a read/write lock for reading.
  *
  * \note Recursion is allowed.
- * \note This function may be a point of cancellation.
  */
 VLC_API void vlc_rwlock_rdlock(vlc_rwlock_t *);
 
 /**
  * Acquires a read/write lock for writing. Recursion is not allowed.
- * \note This function may be a point of cancellation.
  */
 VLC_API void vlc_rwlock_wrlock(vlc_rwlock_t *);
 
diff --git a/src/misc/threads.c b/src/misc/threads.c
index e32e5d58d4..196e0dc1d0 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -410,9 +410,7 @@ void vlc_rwlock_rdlock (vlc_rwlock_t *lock)
     while (lock->state < 0)
     {
         assert (lock->state == WRITER_BIT);
-        mutex_cleanup_push (&lock->mutex);
         vlc_cond_wait (&lock->wait, &lock->mutex);
-        vlc_cleanup_pop ();
     }
     if (unlikely(lock->state >= READER_MASK))
         abort (); /* An overflow is certainly a recursion bug. */
@@ -425,11 +423,7 @@ void vlc_rwlock_wrlock (vlc_rwlock_t *lock)
     vlc_mutex_lock (&lock->mutex);
     /* Wait until nobody owns the lock in any way. */
     while (lock->state != 0)
-    {
-        mutex_cleanup_push (&lock->mutex);
         vlc_cond_wait (&lock->wait, &lock->mutex);
-        vlc_cleanup_pop ();
-    }
     lock->state = WRITER_BIT;
     vlc_mutex_unlock (&lock->mutex);
 }



More information about the vlc-commits mailing list