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