From 9205e486091c3901d0e5aa9a0384dc07dae6114d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 14 Aug 2011 15:17:36 -0400 Subject: [PATCH] macro for pthread_equal no sense bloating apps with a function call for an equality comparison... --- include/pthread.h | 2 ++ src/thread/pthread_equal.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/pthread.h b/include/pthread.h index a0af20fe..44a71019 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -80,7 +80,9 @@ int pthread_join(pthread_t, void **); __attribute__((const)) #endif pthread_t pthread_self(void); + int pthread_equal(pthread_t, pthread_t); +#define pthread_equal(x,y) ((x)==(y)) int pthread_setcancelstate(int, int *); int pthread_setcanceltype(int, int *); diff --git a/src/thread/pthread_equal.c b/src/thread/pthread_equal.c index a55d280c..3e3df4fd 100644 --- a/src/thread/pthread_equal.c +++ b/src/thread/pthread_equal.c @@ -1,6 +1,6 @@ #include -int pthread_equal(pthread_t a, pthread_t b) +int (pthread_equal)(pthread_t a, pthread_t b) { return a==b; } -- GitLab