[vlc-devel] [PATCH 7/7] threads: remove cancellation from vlc_rwlock_t

RĂ©mi Denis-Courmont remi at remlab.net
Tue Apr 14 21:45:44 CEST 2020


This was never used.
---
 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);
 }
-- 
2.26.0



More information about the vlc-devel mailing list