[vlc-commits] [Git][videolan/vlc][master] executor: broadcast while locked

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Feb 7 06:09:51 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
21cb9519 by Thomas Guillem at 2024-02-06T17:50:12+00:00
executor: broadcast while locked

It's legal to do it after the lock but we always do it while locked, as
most (if not all) implementations handle this specific case.

- - - - -


1 changed file:

- src/misc/executor.c


Changes:

=====================================
src/misc/executor.c
=====================================
@@ -266,11 +266,11 @@ vlc_executor_Delete(vlc_executor_t *executor)
     /* All the tasks must be canceled on delete */
     assert(vlc_list_is_empty(&executor->queue));
 
-    vlc_mutex_unlock(&executor->lock);
-
     /* "closing" is now true, this will wake up threads */
     vlc_cond_broadcast(&executor->queue_wait);
 
+    vlc_mutex_unlock(&executor->lock);
+
     /* The threads list may not be written at this point, so it is safe to read
      * it without mutex locked (the mutex must be released to join the
      * threads). */



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/21cb95199d6ed32080344ec1c1af8272cb5dcb44

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/21cb95199d6ed32080344ec1c1af8272cb5dcb44
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list