aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-11-16 23:32:52 +0000
committerUlrich Drepper <drepper@redhat.com>2005-11-16 23:32:52 +0000
commite6e493bbc4a8122acfba53ecf719e10d82974aa3 (patch)
tree7379699c602476bce67141da03cd376533da92e9
parent510afb6420c517607d7084b40998ebd06a73c69d (diff)
downloadglibc-e6e493bbc4a8122acfba53ecf719e10d82974aa3.tar
glibc-e6e493bbc4a8122acfba53ecf719e10d82974aa3.tar.gz
glibc-e6e493bbc4a8122acfba53ecf719e10d82974aa3.tar.bz2
glibc-e6e493bbc4a8122acfba53ecf719e10d82974aa3.zip
* sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
a write barrier before writing libgcc_s_getcfa.
-rw-r--r--nptl/ChangeLog5
-rw-r--r--nptl/sysdeps/pthread/unwind-forcedunwind.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index db084dfcc2..2b76775bcc 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-17 Jakub Jelinek <jakub@redhat.com>
+
+ * sysdeps/pthread/unwind-forcedunwind.c (pthread_cancel_init): Put
+ a write barrier before writing libgcc_s_getcfa.
+
2005-11-06 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/configure: Removed.
diff --git a/nptl/sysdeps/pthread/unwind-forcedunwind.c b/nptl/sysdeps/pthread/unwind-forcedunwind.c
index b0f8487086..9a38704aeb 100644
--- a/nptl/sysdeps/pthread/unwind-forcedunwind.c
+++ b/nptl/sysdeps/pthread/unwind-forcedunwind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>.
@@ -56,6 +56,10 @@ pthread_cancel_init (void)
libgcc_s_resume = resume;
libgcc_s_personality = personality;
libgcc_s_forcedunwind = forcedunwind;
+ /* Make sure libgcc_s_getcfa is written last. Otherwise,
+ pthread_cancel_init might return early even when the pointer the
+ caller is interested in is not initialized yet. */
+ atomic_write_barrier ();
libgcc_s_getcfa = getcfa;
}