From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 88CC9A054F; Sat, 11 Jun 2022 00:48:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C2AD40222; Sat, 11 Jun 2022 00:48:22 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id A100A40041 for ; Sat, 11 Jun 2022 00:48:20 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id C206120BE6B9; Fri, 10 Jun 2022 15:48:19 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C206120BE6B9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1654901299; bh=lojuElZUp5L6YjBVyDePC1XjnpiMPVUi5PilE9AN818=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k5oPq0ZkKwB67wUK9aznf8sFc05rLr3gv+avz41MMkRVXGKymzkze2v+7sPT8JWQZ 3KnfJcwAGX6fi8OHFqh+ssLH9Ku4jbqSvXiSLG0J0ls0jcrQ5rHGKB96kL2eRe6Mau pMkwByAFxHnRNUmniq9LtfWsYP3yzBoHUZ+GtrBw= Date: Fri, 10 Jun 2022 15:48:19 -0700 From: Tyler Retzlaff To: Konstantin Ananyev Cc: dev@dpdk.org, thomas@monjalon.net, dmitry.kozliuk@gmail.com, anatoly.burakov@intel.com, Narcisa Vasile Subject: Re: [PATCH 3/6] eal: add basic rte thread ID equal API Message-ID: <20220610224819.GA14494@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1654783134-13303-1-git-send-email-roretzla@linux.microsoft.com> <1654783134-13303-4-git-send-email-roretzla@linux.microsoft.com> <3f267f58-3c30-8963-3b03-c33e4c270397@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3f267f58-3c30-8963-3b03-c33e4c270397@yandex.ru> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Jun 09, 2022 at 11:24:12PM +0100, Konstantin Ananyev wrote: > 09/06/2022 14:58, Tyler Retzlaff пишет: > >Add rte_thread_equal() that tests if two rte_thread_id are equal. > > > >Signed-off-by: Narcisa Vasile > >Signed-off-by: Tyler Retzlaff > >--- > > lib/eal/common/rte_thread.c | 6 ++++++ > > lib/eal/include/rte_thread.h | 19 +++++++++++++++++++ > > lib/eal/version.map | 1 + > > 3 files changed, 26 insertions(+) > > > >diff --git a/lib/eal/common/rte_thread.c b/lib/eal/common/rte_thread.c > >index 10d6652..21ed042 100644 > >--- a/lib/eal/common/rte_thread.c > >+++ b/lib/eal/common/rte_thread.c > >@@ -6,6 +6,12 @@ > > #include > > int > >+rte_thread_equal(rte_thread_t t1, rte_thread_t t2) > >+{ > >+ return t1.opaque_id == t2.opaque_id; > > for posix systems, why not: > return pthread_equal(t1.opaque_id, t2.opaque_id); because it would require 2 implementations when this works for both windows and posix platforms. (less code to maintain, no functional difference).