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 B7397464C0 for ; Sat, 19 Aug 2023 13:06:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CE2D268C572; Sat, 19 Aug 2023 16:06:13 +0300 (EEST) Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 92B6C68C068 for ; Sat, 19 Aug 2023 16:06:07 +0300 (EEST) Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-6bcb15aa074so1029588a34.0 for ; Sat, 19 Aug 2023 06:06:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692450365; x=1693055165; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=st+XwJ9OHjb4hk3tnSA0zfypUQ7KJApBt52kKluvIjs=; b=Xix71b2HMvEPMv+KFYE/gZH/PqQ0EdMCJaKudOSA45oRLhwS8JIWrfGWrNWUDX1TMo 8mw2g5YLnKMIcC+NTWRiG7s3MmClA5waMyC3X/d8CZ1hbZNL7uANwTNbvDW98UPZaX5l pg2RiSTwfJ+NkNj3JSzhBGVdEEs5ZY4HlVPUtTOlsdh4mIluEnsdlULHQA2VN7Ws1ZzK HtjLrzbTNM37b5CTd826jJLw3dbli3Zcj5yITsZKu4jl0JclR+IuDJkqkUhKvZigx8+f hk+Yjp7JWhFDlePi39SO4/lIPAwe/j4/e92d9HFbJsIl2SuIoGz/liZrNBMJaIIhSNEo HcJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692450365; x=1693055165; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=st+XwJ9OHjb4hk3tnSA0zfypUQ7KJApBt52kKluvIjs=; b=ihCXRdA1+jO/fh1sy7RYx/wb2AwDJLjzsT9SYEdXB0+c27uDJEkk5fP3dXIyfSBc9n nG9/ZxqOitm9m22hEzBrLjXAuEfF2r+Ez7+iZqVoZ5q5Ic1ee2dW8F9eypFepX6oEzAg SeaNbYKwZhfuVje43KRGs/ZHNiMKDFTJj565AFgIjDNrjUNSedYNbiFpNaAvDluk39vM XKUmlL8OeEPZXPkSB+o2m9OQPKJHWvDzRuS18O36ALWb1kkkCgCDNy2EkIhlh5KQ8rab nVYmszmuZlMK+RpOTLf0xoDKSvkNB8imcndTm5t6A+AiJh6o52uoo45gbNsHRdhtgvjT r3iA== X-Gm-Message-State: AOJu0YyyYnF7EyQUeQtZDueMXpXWiNdM56cMeTJQaUYeNLQapk/zMs4j Y6K+ohblPtRLJXI2KimuN/rakBQVVkk= X-Google-Smtp-Source: AGHT+IGlGXq3A+RJ8DjukUSU0OhZ2/INGGZr3Ppth0fXojMyx6e7VLCZhUyXfVoLaYtmXHvRQe8eUQ== X-Received: by 2002:a9d:7112:0:b0:6bd:7a0f:5c52 with SMTP id n18-20020a9d7112000000b006bd7a0f5c52mr1520774otj.12.1692450365121; Sat, 19 Aug 2023 06:06:05 -0700 (PDT) Received: from [192.168.0.16] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id i14-20020a4aab0e000000b005678320f1f2sm1682489oon.13.2023.08.19.06.06.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Aug 2023 06:06:04 -0700 (PDT) Message-ID: <8a52556e-ac4d-4a56-a043-dec234a7ae9f@gmail.com> Date: Sat, 19 Aug 2023 10:06:11 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 To: ffmpeg-devel@ffmpeg.org References: <20230818201613.GZ7802@pb2> <20230818220314.3991-1-jamrial@gmail.com> Content-Language: en-US From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v3] avutil/thread: add wrappers for pthread_cond_t and pthread_t functions 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 8/19/2023 8:55 AM, Andreas Rheinhardt wrote: > James Almer: >> Signed-off-by: James Almer >> --- >> libavutil/thread.h | 30 ++++++++++++++++++++++++++++++ >> 1 file changed, 30 insertions(+) >> >> diff --git a/libavutil/thread.h b/libavutil/thread.h >> index 2f5e7e1cb5..f67b0cdc44 100644 >> --- a/libavutil/thread.h >> +++ b/libavutil/thread.h >> @@ -163,11 +163,25 @@ static inline int strict_pthread_once(pthread_once_t *once_control, void (*init_ >> #define ff_mutex_unlock pthread_mutex_unlock >> #define ff_mutex_destroy pthread_mutex_destroy >> >> +#define AVCond pthread_cond_t >> + >> +#define ff_cond_init pthread_cond_init >> +#define ff_cond_destroy pthread_cond_destroy >> +#define ff_cond_signal pthread_cond_signal >> +#define ff_cond_broadcast pthread_cond_broadcast >> +#define ff_cond_wait pthread_cond_wait >> +#define ff_cond_timedwait pthread_cond_timedwait >> + >> #define AVOnce pthread_once_t >> #define AV_ONCE_INIT PTHREAD_ONCE_INIT >> >> #define ff_thread_once(control, routine) pthread_once(control, routine) >> >> +#define AVThread pthread_t >> + >> +#define ff_thread_create pthread_create >> +#define ff_thread_join pthread_join >> + >> #else >> >> #define AVMutex char >> @@ -178,6 +192,16 @@ static inline int ff_mutex_lock(AVMutex *mutex){ return 0; } >> static inline int ff_mutex_unlock(AVMutex *mutex){ return 0; } >> static inline int ff_mutex_destroy(AVMutex *mutex){ return 0; } >> >> +#define AVCond char >> + >> +static inline int ff_cond_init(AVCond *cond, const void *attr){ return 0; } >> +static inline int ff_cond_destroy(AVCond *cond){ return 0; } >> +static inline int ff_cond_signal(AVCond *cond){ return 0; } >> +static inline int ff_cond_broadcast(AVCond *cond){ return 0; } >> +static inline int ff_cond_wait(AVCond *cond, AVMutex *mutex){ return 0; } >> +static inline int ff_cond_timedwait(AVCond *cond, AVMutex *mutex, >> + const void *abstime){ return 0; } >> + >> #define AVOnce char >> #define AV_ONCE_INIT 0 >> >> @@ -190,6 +214,12 @@ static inline int ff_thread_once(char *control, void (*routine)(void)) >> return 0; >> } >> >> +#define AVThread char >> + >> +static inline int ff_thread_create(AVThread *thread, const void *unused_attr, >> + void *(*start_routine)(void*), void *arg){ return 0; } >> +static inline int ff_thread_join(AVThread thread, void **value_ptr){ return 0; } >> + >> #endif >> >> static inline int ff_thread_setname(const char *name) > > The commit message should explain what the gain of this is; after all, > we managed to make it without these wrappers until now. Removed the pthread_create/join wrappers as those should probably not be handled like the mutex/cond/once functions, added a comment about this being useful for the upcoming threaded executor API, and pushed. _______________________________________________ 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".