The branch, master has been updated
via 4deb8b3a7a3fc6131c8adb90ee9e32f7f2029575 (commit)
from 68152978b522c0a24a3e4d26af2a5fbeffb22e24 (commit)
- Log -----------------------------------------------------------------
commit 4deb8b3a7a3fc6131c8adb90ee9e32f7f2029575
Author: Kacper MichajÅow <[email protected]>
AuthorDate: Mon Oct 27 11:54:02 2025 +0100
Commit: Kacper MichajÅow <[email protected]>
CommitDate: Mon Oct 27 11:54:53 2025 +0100
avutil/vulkan_glslang: use AVMutex instead of pthread_mutex_t
Signed-off-by: Kacper MichajÅow <[email protected]>
diff --git a/libavutil/vulkan_glslang.c b/libavutil/vulkan_glslang.c
index 4cf54de854..20102c4fd7 100644
--- a/libavutil/vulkan_glslang.c
+++ b/libavutil/vulkan_glslang.c
@@ -16,16 +16,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <pthread.h>
-
#include <glslang/build_info.h>
#include <glslang/Include/glslang_c_interface.h>
#include "vulkan_spirv.h"
#include "libavutil/mem.h"
#include "libavutil/avassert.h"
+#include "libavutil/thread.h"
-static pthread_mutex_t glslc_mutex = PTHREAD_MUTEX_INITIALIZER;
+static AVMutex glslc_mutex = AV_MUTEX_INITIALIZER;
static int glslc_refcount = 0;
static const glslang_resource_t glslc_resource_limits = {
@@ -277,10 +276,10 @@ static void glslc_uninit(FFVkSPIRVCompiler **ctx)
if (!ctx || !*ctx)
return;
- pthread_mutex_lock(&glslc_mutex);
+ ff_mutex_lock(&glslc_mutex);
if (glslc_refcount && (--glslc_refcount == 0))
glslang_finalize_process();
- pthread_mutex_unlock(&glslc_mutex);
+ ff_mutex_unlock(&glslc_mutex);
av_freep(ctx);
}
@@ -295,14 +294,14 @@ FFVkSPIRVCompiler *ff_vk_glslang_init(void)
ret->free_shader = glslc_shader_free;
ret->uninit = glslc_uninit;
- pthread_mutex_lock(&glslc_mutex);
+ ff_mutex_lock(&glslc_mutex);
if (!glslc_refcount++) {
if (!glslang_initialize_process()) {
av_freep(&ret);
glslc_refcount--;
}
}
- pthread_mutex_unlock(&glslc_mutex);
+ ff_mutex_unlock(&glslc_mutex);
return ret;
}
-----------------------------------------------------------------------
Summary of changes:
libavutil/vulkan_glslang.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
hooks/post-receive
--
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]