(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.
/* Set the flag making the change visible to the signal handler. */
AO_store_release(&t->suspended_ext, TRUE);
- if ((pthread_t)thread == pthread_self()) {
+ if (THREAD_EQUAL((pthread_t)thread, pthread_self())) {
UNLOCK();
/* It is safe as "t" cannot become invalid here (no race with */
/* GC_unregister_my_thread). */
"Called GC_unregister_my_thread on %p, gc_thread = %p\n",
(void *)self, (void *)me);
# endif
- GC_ASSERT(me->id == self);
+ GC_ASSERT(THREAD_EQUAL(me->id, self));
GC_unregister_my_thread_inner(me);
RESTORE_CANCEL(cancel_state);
UNLOCK();
# 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;
}
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;