diff options
Diffstat (limited to 'pthread/pt-dealloc.c')
-rw-r--r-- | pthread/pt-dealloc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pthread/pt-dealloc.c b/pthread/pt-dealloc.c index f89f354..879608b 100644 --- a/pthread/pt-dealloc.c +++ b/pthread/pt-dealloc.c @@ -26,7 +26,7 @@ #include <atomic.h> /* List of thread structures corresponding to free thread IDs. */ -extern uatomicptr_t __pthread_free_threads; +extern atomicptr_t __pthread_free_threads; /* Deallocate the thread structure for PTHREAD and the resources associated with it. */ @@ -55,8 +55,10 @@ __pthread_dealloc (struct __pthread *pthread) { pthread->next = (struct __pthread *)__pthread_free_threads; if (atomic_compare_and_exchange_val_acq (&__pthread_free_threads, - pthread->next, pthread)) - return; + (uintptr_t) pthread, + (uintptr_t) pthread->next) + == (uintptr_t) pthread->next) + break; } /* NOTREACHED */ |