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 D98C5A0542; Wed, 5 Oct 2022 19:07:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 34FC742686; Wed, 5 Oct 2022 19:07:43 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 7DD34410FB for ; Wed, 5 Oct 2022 19:07:40 +0200 (CEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id C432520E97DD; Wed, 5 Oct 2022 10:07:39 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C432520E97DD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1664989659; bh=VAOZyC8R0+L+4P9QYMWetpiJQqNLqul69kzxU8ek6QQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dhBY50SbC8sgf4Kz99DAXsjMnyQa5soRhboJ/gmegl8eAcZy8m3KZdZ7bl+Ztviyu /qwtVcBpy9/dfVO+BmT9M4DrbeOgrdzr0oBjTkx9LFkBeSFwVb2AIvephhbPXThA4F J85hEjq58aXBYqTgU4xiNI5QVg7+8WGXND2vjWOc= From: Tyler Retzlaff To: dev@dpdk.org Cc: thomas@monjalon.net, dmitry.kozliuk@gmail.com, anatoly.burakov@intel.com, david.marchand@redhat.com Subject: [PATCH v5 3/6] eal: add basic rte thread ID equal API Date: Wed, 5 Oct 2022 10:07:28 -0700 Message-Id: <1664989651-29303-4-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1664989651-29303-1-git-send-email-roretzla@linux.microsoft.com> References: <1654783134-13303-1-git-send-email-roretzla@linux.microsoft.com> <1664989651-29303-1-git-send-email-roretzla@linux.microsoft.com> 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 Add rte_thread_equal() that tests if two rte_thread_id are equal. Signed-off-by: Narcisa Vasile Signed-off-by: Tyler Retzlaff Acked-by: Chengwen Feng --- lib/eal/unix/rte_thread.c | 6 ++++++ lib/eal/version.map | 1 + lib/eal/windows/rte_thread.c | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/lib/eal/unix/rte_thread.c b/lib/eal/unix/rte_thread.c index d4c1a7f..37ebfcf 100644 --- a/lib/eal/unix/rte_thread.c +++ b/lib/eal/unix/rte_thread.c @@ -210,6 +210,12 @@ struct thread_routine_ctx { return pthread_detach((pthread_t)thread_id.opaque_id); } +int +rte_thread_equal(rte_thread_t t1, rte_thread_t t2) +{ + return pthread_equal((pthread_t)t1.opaque_id, (pthread_t)t2.opaque_id); +} + rte_thread_t rte_thread_self(void) { diff --git a/lib/eal/version.map b/lib/eal/version.map index 5fd84b6..2d64a25 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -438,6 +438,7 @@ EXPERIMENTAL { rte_thread_attr_set_priority; rte_thread_create; rte_thread_detach; + rte_thread_equal; rte_thread_join; }; diff --git a/lib/eal/windows/rte_thread.c b/lib/eal/windows/rte_thread.c index e153278..1c1e9d0 100644 --- a/lib/eal/windows/rte_thread.c +++ b/lib/eal/windows/rte_thread.c @@ -289,6 +289,12 @@ struct thread_routine_ctx { return 0; } +int +rte_thread_equal(rte_thread_t t1, rte_thread_t t2) +{ + return t1.opaque_id == t2.opaque_id; +} + rte_thread_t rte_thread_self(void) { -- 1.8.3.1