diff options
Diffstat (limited to 'pthread')
-rw-r--r-- | pthread/pt-create.c | 8 | ||||
-rw-r--r-- | pthread/pt-dealloc.c | 4 | ||||
-rw-r--r-- | pthread/pt-exit.c | 4 | ||||
-rw-r--r-- | pthread/pt-internal.h | 6 |
4 files changed, 11 insertions, 11 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: diff --git a/pthread/pt-dealloc.c b/pthread/pt-dealloc.c index 806e078..1807a1d 100644 --- a/pthread/pt-dealloc.c +++ b/pthread/pt-dealloc.c @@ -22,7 +22,7 @@ #include <pt-internal.h> -#include <bits/pt-atomic.h> +#include <atomic.h> /* List of thread structures corresponding to free thread IDs. */ extern struct __pthread *__pthread_free_threads; @@ -35,7 +35,7 @@ __pthread_dealloc (struct __pthread *pthread) { assert (pthread->state != PTHREAD_TERMINATED); - if (! __atomic_dec_and_test (&pthread->nr_refs)) + if (! atomic_decrement_and_test (&pthread->nr_refs)) return; /* Withdraw this thread from the thread ID lookup table. */ diff --git a/pthread/pt-exit.c b/pthread/pt-exit.c index a23a540..14e560e 100644 --- a/pthread/pt-exit.c +++ b/pthread/pt-exit.c @@ -23,7 +23,7 @@ #include <pt-internal.h> -#include <bits/pt-atomic.h> +#include <atomic.h> /* Terminate the current thread and make STATUS available to any @@ -49,7 +49,7 @@ __pthread_exit (void *status) /* Decrease the number of threads. We use an atomic operation to make sure that only the last thread calls `exit'. */ - if (__atomic_dec_and_test (&__pthread_total)) + if (atomic_decrement_and_test (&__pthread_total)) /* We are the last thread. */ exit (0); diff --git a/pthread/pt-internal.h b/pthread/pt-internal.h index 3024e64..24111ad 100644 --- a/pthread/pt-internal.h +++ b/pthread/pt-internal.h @@ -26,7 +26,7 @@ #include <assert.h> #include <bits/types/res_state.h> -#include <bits/pt-atomic.h> +#include <atomic.h> #include <pt-key.h> @@ -76,7 +76,7 @@ struct __pthread /* Thread ID. */ pthread_t thread; - __atomic_t nr_refs; /* Detached threads have a self reference only, + unsigned int nr_refs; /* Detached threads have a self reference only, while joinable threads have two references. These are used to keep the structure valid at thread destruction. Detaching/joining a thread @@ -171,7 +171,7 @@ __pthread_dequeue (struct __pthread *thread) ) /* The total number of threads currently active. */ -extern __atomic_t __pthread_total; +extern unsigned int __pthread_total; /* The total number of thread IDs currently in use, or on the list of available thread IDs. */ |