23 |
|
|
24 |
#include <pt-internal.h> |
#include <pt-internal.h> |
25 |
|
|
26 |
#include <bits/atomic.h> |
#include <atomic.h> |
27 |
|
|
28 |
/* List of thread structures corresponding to free thread IDs. */ |
/* List of thread structures corresponding to free thread IDs. */ |
29 |
extern __atomicptr_t __pthread_free_threads; |
extern uatomicptr_t __pthread_free_threads; |
30 |
|
|
31 |
/* Deallocate the thread structure for PTHREAD and the resources |
/* Deallocate the thread structure for PTHREAD and the resources |
32 |
associated with it. */ |
associated with it. */ |
54 |
while (1) |
while (1) |
55 |
{ |
{ |
56 |
pthread->next = (struct __pthread *)__pthread_free_threads; |
pthread->next = (struct __pthread *)__pthread_free_threads; |
57 |
if (__atomicptr_compare_and_swap (&__pthread_free_threads, |
if (atomic_compare_and_exchange_val_acq (&__pthread_free_threads, |
58 |
pthread->next, pthread)) |
pthread->next, pthread)) |
59 |
return; |
return; |
60 |
} |
} |
61 |
|
|