[PATCH 3/6] eal: add basic rte thread ID equal API
Tyler Retzlaff
roretzla at linux.microsoft.com
Sat Jun 11 00:48:19 CEST 2022
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 <navasile at microsoft.com>
> >Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
> >---
> > 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 <rte_thread.h>
> > 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).
More information about the dev
mailing list