summaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-02-15 09:49:02 +0000
committerUlrich Drepper <drepper@redhat.com>2003-02-15 09:49:02 +0000
commit90491dc4bf7a2c4232565ea68c9bda1383f97ae6 (patch)
treed00ccc5fc77334ca06edeaa13afc6a3ad083f047 /nptl
parentc6247c9d7daab9faa51ae571d4b12a337e9b15ff (diff)
downloadglibc-90491dc4bf7a2c4232565ea68c9bda1383f97ae6.tar.gz
Update.
* pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb, and __deallocate_stack with internal_function. * pthread_create.c: Adjust definitions appropriately. * allocatestack.c: Likewise. * pthread_join.c: Add one more __builtin_expect. * pthread_timedjoin.c: Likewise. * pthread_getspecific.c (__pthread_getspecific): Clear data->data not data of sequence number does not match. Add one __builtin_expect.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog12
-rw-r--r--nptl/allocatestack.c1
-rw-r--r--nptl/pthreadP.h7
-rw-r--r--nptl/pthread_create.c2
-rw-r--r--nptl/pthread_getspecific.c4
-rw-r--r--nptl/pthread_join.c3
-rw-r--r--nptl/pthread_timedjoin.c5
7 files changed, 26 insertions, 8 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index c4556cc1c8..4aa4bb6286 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,5 +1,17 @@
2003-02-15 Ulrich Drepper <drepper@redhat.com>
+ * pthreadP.h: Mark declarations of __find_in_stack_list, __free_tcb,
+ and __deallocate_stack with internal_function.
+ * pthread_create.c: Adjust definitions appropriately.
+ * allocatestack.c: Likewise.
+
+ * pthread_join.c: Add one more __builtin_expect.
+ * pthread_timedjoin.c: Likewise.
+
+ * pthread_getspecific.c (__pthread_getspecific): Clear data->data
+ not data of sequence number does not match.
+ Add one __builtin_expect.
+
* Makefile (tests): Add tst-clock1.
* tst-clock1.c: New file.
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 9d7f7618ec..57cb2717ec 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -477,6 +477,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
void
+internal_function
__deallocate_stack (struct pthread *pd)
{
lll_lock (stack_cache_lock);
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 784f62416f..2b65192f68 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -154,14 +154,15 @@ __do_cancel (void)
/* Thread list handling. */
extern struct pthread *__find_in_stack_list (struct pthread *pd)
- attribute_hidden;
+ attribute_hidden internal_function;
/* Deallocate a thread's stack after optionally making sure the thread
descriptor is still valid. */
-extern void __free_tcb (struct pthread *pd) attribute_hidden;
+extern void __free_tcb (struct pthread *pd) attribute_hidden internal_function;
/* Free allocated stack. */
-extern void __deallocate_stack (struct pthread *pd) attribute_hidden;
+extern void __deallocate_stack (struct pthread *pd)
+ attribute_hidden internal_function;
/* Mark all the stacks except for the current one as available. This
function also re-initializes the lock for the stack cache. */
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index c96a2813e5..6a590904d4 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -65,6 +65,7 @@ hidden_def (__pthread_keys)
const int __pthread_pthread_sizeof_descr = sizeof (struct pthread);
struct pthread *
+internal_function
__find_in_stack_list (pd)
struct pthread *pd;
{
@@ -175,6 +176,7 @@ deallocate_tsd (struct pthread *pd)
/* Deallocate a thread's stack after optionally making sure the thread
descriptor is still valid. */
void
+internal_function
__free_tcb (struct pthread *pd)
{
/* The thread is exiting now. */
diff --git a/nptl/pthread_getspecific.c b/nptl/pthread_getspecific.c
index 24c472d640..afb4d26ffd 100644
--- a/nptl/pthread_getspecific.c
+++ b/nptl/pthread_getspecific.c
@@ -59,8 +59,8 @@ __pthread_getspecific (key)
{
uintptr_t seq = data->seq;
- if (seq != __pthread_keys[key].seq)
- result = data = NULL;
+ if (__builtin_expect (seq != __pthread_keys[key].seq, 0))
+ result = data->data = NULL;
}
return result;
diff --git a/nptl/pthread_join.c b/nptl/pthread_join.c
index 5954af778d..387f230576 100644
--- a/nptl/pthread_join.c
+++ b/nptl/pthread_join.c
@@ -66,7 +66,8 @@ pthread_join (threadid, thread_return)
/* Wait for the thread to finish. If it is already locked something
is wrong. There can only be one waiter. */
- if (atomic_compare_and_exchange_acq (&pd->joinid, self, NULL) != 0)
+ if (__builtin_expect (atomic_compare_and_exchange_acq (&pd->joinid, self,
+ NULL) != 0, 0))
/* There is already somebody waiting for the thread. */
return EINVAL;
diff --git a/nptl/pthread_timedjoin.c b/nptl/pthread_timedjoin.c
index 7725c52229..dd51fea4aa 100644
--- a/nptl/pthread_timedjoin.c
+++ b/nptl/pthread_timedjoin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -64,7 +64,8 @@ pthread_timedjoin_np (threadid, thread_return, abstime)
/* Wait for the thread to finish. If it is already locked something
is wrong. There can only be one waiter. */
- if (atomic_compare_and_exchange_acq (&pd->joinid, self, NULL) != 0)
+ if (__builtin_expect (atomic_compare_and_exchange_acq (&pd->joinid, self,
+ NULL) != 0, 0))
/* There is already somebody waiting for the thread. */
return EINVAL;