aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-04-05 05:08:05 +0000
committerUlrich Drepper <drepper@redhat.com>2003-04-05 05:08:05 +0000
commit3242201746d74bfbccb8267f8b2e81a9478bf78b (patch)
tree59672c3eb0dc72102d9d52475b648f7c6de453b8
parentd0f534e9a19823a3fa473aaeb61d37394b6bb753 (diff)
downloadglibc-3242201746d74bfbccb8267f8b2e81a9478bf78b.tar
glibc-3242201746d74bfbccb8267f8b2e81a9478bf78b.tar.gz
glibc-3242201746d74bfbccb8267f8b2e81a9478bf78b.tar.bz2
glibc-3242201746d74bfbccb8267f8b2e81a9478bf78b.zip
Define THREAD_ATOMIC_CMPXCHG_VAL and THREAD_ATOMIC_BIT_SET if not already defined.
-rw-r--r--nptl/pthreadP.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 725c87d6bb..db345d505f 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -131,6 +131,18 @@ extern int __pthread_debug attribute_hidden;
#define SIGTIMER (__SIGRTMIN + 1)
+/* Atomic operations on TLS memory. */
+#ifndef THREAD_ATOMIC_CMPXCHG_VAL
+# define THREAD_ATOMIC_CMPXCHG_VAL(descr, member, new, old) \
+ atomic_compare_and_exchange_val_acq (&(descr)->member, new, old)
+#endif
+
+#ifndef THREAD_ATOMIC_BIT_SET
+# define THREAD_ATOMIC_BIT_SET(descr, member, bit) \
+ atomic_bit_set (&(descr)->member, bit)
+#endif
+
+
/* This function is responsible for calling all registered cleanup
handlers and then terminate the thread. This includes dellocating
the thread-specific data. The implementation is complicated by the
@@ -151,7 +163,7 @@ __do_cancel (void)
struct pthread *self = THREAD_SELF;
/* Make sure we get no more cancellations. */
- atomic_bit_set (&self->cancelhandling, EXITING_BIT);
+ THREAD_ATOMIC_BIT_SET (self, cancelhandling, EXITING_BIT);
/* Throw an exception. */
// XXX TBI