[vlc-commits] posix: add missing cancellation point

Rémi Denis-Courmont git at videolan.org
Thu Feb 27 21:29:49 CET 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 26 21:27:45 2020 +0200| [53139af8ddacd34f6c9d32726175a6eec7e7ce4b] | committer: Rémi Denis-Courmont

posix: add missing cancellation point

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

 src/posix/wait.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/posix/wait.c b/src/posix/wait.c
index 26bce27448..a6d58d721b 100644
--- a/src/posix/wait.c
+++ b/src/posix/wait.c
@@ -83,6 +83,8 @@ void vlc_atomic_wait(void *addr, unsigned value)
 
     if (value == atomic_load_explicit(futex, memory_order_relaxed))
         pthread_cond_wait(&bucket->wait, &bucket->lock);
+    else
+        pthread_testcancel();
 
     pthread_cleanup_pop(1);
 }
@@ -98,6 +100,8 @@ static int vlc_atomic_timedwait_timespec(void *addr, unsigned value,
 
     if (value == atomic_load_explicit(futex, memory_order_relaxed))
         ret = pthread_cond_timedwait(&bucket->wait, &bucket->lock, ts);
+    else
+        pthread_testcancel();
 
     pthread_cleanup_pop(1);
     return ret;



More information about the vlc-commits mailing list