diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-03-19 00:47:53 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-03-19 00:47:53 +0100 |
commit | 1efaba2cd9eb0c5af4617c5be01a6b5e96d7d8a0 (patch) | |
tree | 02c0f399da54477fb9d042d28ca009ed8aca6f84 /pthread/pt-create.c | |
parent | 332c0bf4bca963ee6f104634349546864ecf62e5 (diff) |
Remove bits/pt-atomic.h
* pthread/pt-create.c: Include <atomic.h> instead of <bits/pt-atomic.h>.
(__pthread_total): Change type from __atomic_t to unsigned int.
(__pthread_create_internal): Use atomic_increment and atomic_decrement
instead of __atomic_inc and __atomic_dec.
* pthread/pt-dealloc.c: Include <atomic.h> instead of
<bits/pt-atomic.h>.
(__pthread_dealloc): Use atomic_decrement_and_test instead of
__atomic_dec_and_test.
* pthread/pt-exit.c: Include <atomic.h> instead of <bits/pt-atomic.h>.
(__pthread_exit): Use atomic_decrement_and_test instead of
__atomic_dec_and_test.
* pthread/pt-internal.h: Include <atomic.h> instead of
<bits/pt-atomic.h>.
(struct __pthread): Use unsigned int type for nr_refs field instead of
__atomic_t.
(__pthread_total): Use unsigned int type instead of nr_refs.
Diffstat (limited to 'pthread/pt-create.c')
-rw-r--r-- | pthread/pt-create.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pthread/pt-create.c b/pthread/pt-create.c index 5ac01c7..cf226cc 100644 --- a/pthread/pt-create.c +++ b/pthread/pt-create.c @@ -22,7 +22,7 @@ #include <signal.h> #include <resolv.h> -#include <bits/pt-atomic.h> +#include <atomic.h> #include <hurd/resource.h> #include <pt-internal.h> @@ -37,7 +37,7 @@ /* The total number of pthreads currently active. This is defined here since it would be really stupid to have a threads-using program that doesn't call `pthread_create'. */ -__atomic_t __pthread_total; +unsigned int __pthread_total; /* The entry-point for new threads. */ @@ -195,7 +195,7 @@ __pthread_create_internal (struct __pthread **thread, the number of threads from within the new thread isn't an option since this thread might return and call `pthread_exit' before the new thread runs. */ - __atomic_inc (&__pthread_total); + atomic_increment (&__pthread_total); /* Store a pointer to this thread in the thread ID lookup table. We could use __thread_setid, however, we only lock for reading as no @@ -226,7 +226,7 @@ __pthread_create_internal (struct __pthread **thread, __pthread_dealloc (pthread); __pthread_setid (pthread->thread, NULL); - __atomic_dec (&__pthread_total); + atomic_decrement (&__pthread_total); failed_sigstate: __pthread_sigstate_destroy (pthread); failed_setup: |