summaryrefslogtreecommitdiffstats
path: root/video/mp_image_pool.c
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-10-21 04:55:41 +0200
committerDudemanguy <random342@airmail.cc>2023-11-05 17:36:17 +0000
commit174df99ffa53f1091589eaa4fa0c16cdd55a9326 (patch)
tree3a60d45615f18beed98a9b08267c28ed7e05dd5f /video/mp_image_pool.c
parent3a8b107f6216b38a151d5ca1e9d4f2727e3418f5 (diff)
downloadmpv-174df99ffa53f1091589eaa4fa0c16cdd55a9326.tar.bz2
mpv-174df99ffa53f1091589eaa4fa0c16cdd55a9326.tar.xz
ALL: use new mp_thread abstraction
Diffstat (limited to 'video/mp_image_pool.c')
-rw-r--r--video/mp_image_pool.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/video/mp_image_pool.c b/video/mp_image_pool.c
index 8f982b414c..0b5e520e10 100644
--- a/video/mp_image_pool.c
+++ b/video/mp_image_pool.c
@@ -19,7 +19,6 @@
#include <stddef.h>
#include <stdbool.h>
-#include <pthread.h>
#include <assert.h>
#include <libavutil/buffer.h>
@@ -35,12 +34,13 @@
#include "common/common.h"
#include "fmt-conversion.h"
-#include "mp_image.h"
#include "mp_image_pool.h"
+#include "mp_image.h"
+#include "osdep/threads.h"
-static pthread_mutex_t pool_mutex = PTHREAD_MUTEX_INITIALIZER;
-#define pool_lock() pthread_mutex_lock(&pool_mutex)
-#define pool_unlock() pthread_mutex_unlock(&pool_mutex)
+static mp_static_mutex pool_mutex = MP_STATIC_MUTEX_INITIALIZER;
+#define pool_lock() mp_mutex_lock(&pool_mutex)
+#define pool_unlock() mp_mutex_unlock(&pool_mutex)
// Thread-safety: the pool itself is not thread-safe, but pool-allocated images
// can be referenced and unreferenced from other threads. (As long as the image