From 2abae9a5c72604456138057e48976a79a618e87d Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 20 Apr 2018 00:32:14 +0300 Subject: Use THREAD_EQUAL consistently to compare pthread_t values (code refactoring) * pthread_stop_world.c [GC_ENABLE_SUSPEND_THREAD] (GC_suspend_thread): Use THREAD_EQUAL() to compare pthread_t values. * pthread_support.c (GC_unregister_my_thread): Likewise. * specific.c [USE_CUSTOM_SPECIFIC] (GC_remove_specific_after_fork, GC_slow_getspecific): Likewise. --- specific.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'specific.c') diff --git a/specific.c b/specific.c index 0ded0360..954b2156 100644 --- a/specific.c +++ b/specific.c @@ -91,7 +91,7 @@ GC_INNER void GC_remove_specific_after_fork(tsd * key, pthread_t t) # endif pthread_mutex_lock(&(key -> lock)); entry = *link; - while (entry != NULL && entry -> thread != t) { + while (entry != NULL && !THREAD_EQUAL(entry->thread, t)) { link = &(entry -> next); entry = *link; } @@ -132,7 +132,7 @@ GC_INNER void * GC_slow_getspecific(tsd * key, word qtid, tse *entry = key->hash[hash_val].p; GC_ASSERT(qtid != INVALID_QTID); - while (entry != NULL && entry -> thread != self) { + while (entry != NULL && !THREAD_EQUAL(entry->thread, self)) { entry = entry -> next; } if (entry == NULL) return NULL; -- cgit v1.2.1