From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 42053465BC for ; Tue, 22 Aug 2023 12:20:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7452668C3BC; Tue, 22 Aug 2023 15:20:44 +0300 (EEST) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AB2A968AFA8 for ; Tue, 22 Aug 2023 15:20:38 +0300 (EEST) Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2b9bb097c1bso68219421fa.0 for ; Tue, 22 Aug 2023 05:20:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692706837; x=1693311637; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=3snXsUgqYOILrVvYHmzo2y7yonwHHDwR+LZcVhQpN3Y=; b=A07UAdCpTQib+yIRLws/WIGWT+FqFEiY4SlmEy9DF4/XWueBe7dYezTnY9/KeO5DGG 5KxRiJ3QutBeM5atzFyotXpzW9vTLbb82lpiwj+NUmVlHb/c/nhc45kpMB5WfxzmrwHd /Lc+m9dZkZx9u0B2iDsUtLxHBN2ZvHH+820MlQeL4EwZw0MnuwVIW4hj9vnTQB4i4Ba+ XqMW7VP7HfWx1lLkX/Xa1J4GL8qP3uVtRxztYfowJl82zm6ODRpCfAUp8iTp/Dc0TBox g2/CEXxU4+1j3J0ASueh/iJLFFCE3YtyQodjGb0Arc5dipA5evbTyfgCJ7Q5gxG1OqCE T1QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692706837; x=1693311637; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3snXsUgqYOILrVvYHmzo2y7yonwHHDwR+LZcVhQpN3Y=; b=OatYCb4z0Ee9IapGbxKDcuCBaTKzVMICfgmzwyZMOmoNnvByaYFQkIV0sJLBqOU6mo 3fYE4NsCRE7TPRVkTW9auj6WTS+KxZegDt7uzCK1G9wDQQOXWRTGcLIYEJMZAuCxdV5K L7rukev46wJrOBM0pUqy+TxvJhD6DhdZa1qII62FRyuu3CvI/pDcee/FZ3bY1leF6DDp w+evuSBVPhGrP7uv2rG5zmVz5rg7X4vx/rVNNtVoOii/Btc9k+839/APcV15zW5B7uRg sOGOTd+QoRWwrQurCiBvHiaaHFzCpi7yg5Wrie/N0yicmlln7uMx8VnpVFSNyqy+f6rb fXJg== X-Gm-Message-State: AOJu0Yz3F3GfViTaP905TnvJlUqTB0N6vdOSqRVK5p7zSk30Q8RUTHRT 7SPQqeLI0n1/yQ3CPmwekGlIX1ZFdMkqXtHh+t1B+RJg+0Y= X-Google-Smtp-Source: AGHT+IF1WpPArDr+owSa6Sfq52OEch1GpnhaNleE7GhC3dDGS9D0iS/qp25Z5/pu7aZCWWYUQxcL+lYhL+7Y4JR0UlM= X-Received: by 2002:a2e:b164:0:b0:2bb:bfa5:b72c with SMTP id a4-20020a2eb164000000b002bbbfa5b72cmr5898066ljm.15.1692706837273; Tue, 22 Aug 2023 05:20:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nuo Mi Date: Tue, 22 Aug 2023 20:20:34 +0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH v4] vvcdec: add thread executor X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: > > > > > + > > +#if !HAVE_THREADS > > +#define pthread_create(t, a, s, ar) 0 > > +#define pthread_join(t, r) do {} while(0) > > + > > +#define pthread_cond_init(c, a) 0 > > +#define pthread_cond_broadcast(c) do {} while(0) > > +#define pthread_cond_signal(c) do {} while(0) > > +#define pthread_cond_wait(c, m) do {} while(0) > > +#define pthread_cond_destroy(c) do {} while(0) > > + > > +#define pthread_mutex_init(m, a) 0 > > +#define pthread_mutex_lock(l) do {} while(0) > > +#define pthread_mutex_unlock(l) do {} while(0) > > +#define pthread_mutex_destroy(l) do {} while(0) > > You have ff_mutex_* and AVMutex for this. I sent a patch adding > ff_cond_* and AVCond, as well as ff_thread_create/join and AVThread to > thread.h to simplify things. Will do it for AVMutex and AVCond. But it's hard to add a wrapper for pthread_t. Because we do not have a way to detect typedef and I do not want to add "#ifdef _BITS_PTHREADTYPES_COMMON_H" > > > +#endif > > + > > +typedef struct ThreadInfo { > > + AVExecutor *e; > > + pthread_t thread; > > +AVExecutor* av_executor_alloc(const AVTaskCallbacks *cb, int > thread_count) > > +{ > > + AVExecutor *e; > > + int has_lock = 0, has_cond = 0; > > + if (!cb || !cb->user_data || !cb->ready || !cb->run || > !cb->priority_higher) > > + return NULL; > > + > > + e = av_calloc(1, sizeof(*e)); > > av_mallocz() > will do > > > + if (!e) > > + return NULL; > > + e->cb = *cb; > > + > > + e->local_contexts = av_calloc(thread_count, > e->cb.local_context_size); > > + if (!e->local_contexts) > > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".