[vlc-devel] [PATCH 4/7] freebsd: remove cancellation in vlc_atomic_wait()

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


---
 src/freebsd/thread.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/freebsd/thread.c b/src/freebsd/thread.c
index f20160b200..49425a462b 100644
--- a/src/freebsd/thread.c
+++ b/src/freebsd/thread.c
@@ -55,16 +55,13 @@ static int vlc_umtx_wait(void *addr, unsigned val, const struct timespec *ts)
         ._flags = UMTX_ABSTIME,
         ._clockid = CLOCK_MONOTONIC,
     };
-    int ret, type;
+    int type;
     /* "the uaddr value [...] must be equal to the size of the structure
      * pointed to by uaddr2, casted to uintptr_t."
      */
     void *uaddr = (void *)sizeof (to);
 
-    pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &type);
-    ret = _umtx_op(addr, UMTX_OP_WAIT_UINT_PRIVATE, val, uaddr, &to);
-    pthread_setcanceltype(type, NULL);
-    return ret;
+    return _umtx_op(addr, UMTX_OP_WAIT_UINT_PRIVATE, val, uaddr, &to);
 }
 
 void vlc_atomic_notify_one(void *addr)
-- 
2.26.0



More information about the vlc-devel mailing list