diff options
author | Michael Scherer <misc@redhat.com> | 2016-04-25 18:23:48 +0200 |
---|---|---|
committer | Michael Scherer <misc@redhat.com> | 2016-04-25 18:43:37 +0200 |
commit | c3353cdc4a3bcea416953af0585a08f33c5d4639 (patch) | |
tree | 45b1caedb6cf2961154afaeeee6ca34d2a9e15ec /libglusterfs | |
parent | a9ccd0c8ea6989c72073028b296f73a6fcb6b896 (diff) |
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 <mscherer@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/syncop.c | 4 |
1 files 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", |