This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 5cf0dbac37605194faea51dd268b2097a59c70a9
Author:     Zhao Zhili <[email protected]>
AuthorDate: Sun Aug 2 19:07:13 2026 +0800
Commit:     Zhao Zhili <[email protected]>
CommitDate: Sat Sep 26 15:32:47 2026 +0000

    libavfilter/dnn: remove incorrect HAVE_PTHREAD_CANCEL guards
    
    HAVE_PTHREAD_CANCEL checks whether pthread_cancel() is available, not
    whether thread support exists at all. It was used in dnn to guard pthread
    API, none of which depend on pthread_cancel. Platforms can have a working
    pthread implementation without pthread_cancel (e.g., Android), so the
    guard could disable the async path on systems that actually support
    threads.
    
    Now that threads is a hard dependency of dnn, remove the guards and the
    sync fallback path they protected.
---
 libavfilter/dnn/dnn_backend_common.c | 10 ----------
 libavfilter/dnn/dnn_backend_common.h |  6 ------
 libavfilter/dnn/dnn_backend_tf.c     |  7 -------
 3 files changed, 23 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_common.c 
b/libavfilter/dnn/dnn_backend_common.c
index 82627c7a96..4d90efecd4 100644
--- a/libavfilter/dnn/dnn_backend_common.c
+++ b/libavfilter/dnn/dnn_backend_common.c
@@ -89,13 +89,11 @@ int ff_dnn_async_module_cleanup(DNNAsyncExecModule 
*async_module)
     if (!async_module) {
         return AVERROR(EINVAL);
     }
-#if HAVE_PTHREAD_CANCEL
     pthread_join(async_module->thread_id, &status);
     if (status == DNN_ASYNC_FAIL) {
         av_log(NULL, AV_LOG_ERROR, "Last Inference Failed.\n");
         return DNN_GENERIC_ERROR;
     }
-#endif
     async_module->start_inference = NULL;
     async_module->callback = NULL;
     async_module->args = NULL;
@@ -120,7 +118,6 @@ int ff_dnn_start_inference_async(void *ctx, 
DNNAsyncExecModule *async_module)
         return AVERROR(EINVAL);
     }
 
-#if HAVE_PTHREAD_CANCEL
     pthread_join(async_module->thread_id, &status);
     if (status == DNN_ASYNC_FAIL) {
         av_log(ctx, AV_LOG_ERROR, "Unable to start inference as previous 
inference failed.\n");
@@ -131,13 +128,6 @@ int ff_dnn_start_inference_async(void *ctx, 
DNNAsyncExecModule *async_module)
         av_log(ctx, AV_LOG_ERROR, "Unable to start async inference.\n");
         return ret;
     }
-#else
-    ret = async_module->start_inference(async_module->args);
-    if (ret != 0) {
-        return ret;
-    }
-    async_module->callback(async_module->args);
-#endif
     return 0;
 }
 
diff --git a/libavfilter/dnn/dnn_backend_common.h 
b/libavfilter/dnn/dnn_backend_common.h
index f0b8b47397..acb4256749 100644
--- a/libavfilter/dnn/dnn_backend_common.h
+++ b/libavfilter/dnn/dnn_backend_common.h
@@ -82,10 +82,7 @@ typedef struct DNNAsyncExecModule {
      * i.e. Request item for the backend.
      */
     void *args;
-#if HAVE_PTHREAD_CANCEL
     pthread_t thread_id;
-    pthread_attr_t thread_attr;
-#endif
 } DNNAsyncExecModule;
 
 int ff_check_exec_params(void *ctx, DNNBackendType backend, DNNFunctionType 
func_type, DNNExecBaseParams *exec_params);
@@ -129,9 +126,6 @@ void ff_dnn_wait_requests(SafeQueue *request_queue, int 
nireq);
  * after the inference completes. Completion callback and inference
  * function must be set before calling this function.
  *
- * If POSIX threads aren't supported, the execution rolls back
- * to synchronous mode, calling completion callback after inference.
- *
  * @param ctx pointer to the backend context
  * @param async_module pointer to DNNAsyncExecModule module
  *
diff --git a/libavfilter/dnn/dnn_backend_tf.c b/libavfilter/dnn/dnn_backend_tf.c
index f8a4d9bc62..6c72783f77 100644
--- a/libavfilter/dnn/dnn_backend_tf.c
+++ b/libavfilter/dnn/dnn_backend_tf.c
@@ -541,13 +541,6 @@ static DNNModel *dnn_load_model_tf(DnnContext *ctx, 
DNNFunctionType func_type, A
         ctx->nireq = av_cpu_count() / 2 + 1;
     }
 
-#if !HAVE_PTHREAD_CANCEL
-    if (ctx->async) {
-        ctx->async = 0;
-        av_log(filter_ctx, AV_LOG_WARNING, "pthread is not supported, roll 
back to sync.\n");
-    }
-#endif
-
     tf_model->request_queue = ff_safe_queue_create();
     if (!tf_model->request_queue) {
         goto err;

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to