summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorMichael Scherer <misc@redhat.com>2016-04-25 18:23:48 +0200
committerMichael Scherer <misc@redhat.com>2016-04-25 18:43:37 +0200
commitc3353cdc4a3bcea416953af0585a08f33c5d4639 (patch)
tree45b1caedb6cf2961154afaeeee6ca34d2a9e15ec /libglusterfs/src
parenta9ccd0c8ea6989c72073028b296f73a6fcb6b896 (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/src')
-rw-r--r--libglusterfs/src/syncop.c4
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",