From c3353cdc4a3bcea416953af0585a08f33c5d4639 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Mon, 25 Apr 2016 18:23:48 +0200 Subject: Use pthread_equal to compare threads The man pages about pthreads are quite clear on the fact that pthread_t is supposed to be opaque, and so can't be compared using the equality operator. Change-Id: Id69e166ed73a98668d19a71cd6d9ab9a0429ec38 BUG: 1330225 Signed-off-by: Michael Scherer --- libglusterfs/src/syncop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index c820be8e151..63b9973a2d1 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -893,7 +893,7 @@ __synclock_lock (struct synclock *lock) } break; case LOCK_THREAD: - if (pthread_self () == lock->owner_tid) { + if (pthread_equal(pthread_self (), lock->owner_tid)) { lock->lock++; gf_msg_trace ("", 0, "Recursive lock called by" " thread ,owner=%u lock=%d", @@ -1012,7 +1012,7 @@ __synclock_unlock (synclock_t *lock) break; case LOCK_THREAD: - if (pthread_self () == lock->owner_tid) { + if (pthread_equal(pthread_self (), lock->owner_tid)) { lock->lock--; gf_msg_trace ("", 0, "Unlock success %u, remaining " "locks=%d", -- cgit