aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--include/atomic.h30
-rw-r--r--nptl/pthreadP.h24
3 files changed, 31 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index 28ef0c6..3b20466 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2003-04-15 Ulrich Drepper <drepper@redhat.com>
+
+ * include/atomic.h: Pretty printing.
+
2003-04-14 Ulrich Drepper <drepper@redhat.com>
* stdio-common/vfscanf.c: Add casts to avoid warnings.
diff --git a/include/atomic.h b/include/atomic.h
index 9889331..725d9c1 100644
--- a/include/atomic.h
+++ b/include/atomic.h
@@ -65,14 +65,14 @@
#if !defined atomic_compare_and_exchange_val_acq \
&& defined __arch_compare_and_exchange_val_32_acq
# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
- __atomic_val_bysize (__arch_compare_and_exchange_val,acq, \
- (mem), (newval), (oldval))
+ __atomic_val_bysize (__arch_compare_and_exchange_val,acq, \
+ mem, newval, oldval)
#endif
#ifndef atomic_compare_and_exchange_val_rel
-# define atomic_compare_and_exchange_val_rel(mem, oldval, newval) \
- atomic_compare_and_exchange_val_acq ((mem), (oldval), (newval))
+# define atomic_compare_and_exchange_val_rel(mem, oldval, newval) \
+ atomic_compare_and_exchange_val_acq (mem, oldval, newval)
#endif
@@ -80,15 +80,15 @@
Return zero if *MEM was changed or non-zero if no exchange happened. */
#ifndef atomic_compare_and_exchange_bool_acq
# ifdef __arch_compare_and_exchange_bool_32_acq
-# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
- __atomic_bool_bysize (__arch_compare_and_exchange_bool,acq, \
- (mem), (newval), (oldval))
-# else
# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+ __atomic_bool_bysize (__arch_compare_and_exchange_bool,acq, \
+ mem, newval, oldval)
+# else
+# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
({ /* Cannot use __oldval here, because macros later in this file might \
call this macro with __oldval argument. */ \
__typeof (oldval) __old = (oldval); \
- atomic_compare_and_exchange_val_acq ((mem), (newval), __old) != __old; \
+ atomic_compare_and_exchange_val_acq (mem, newval, __old) != __old; \
})
# endif
#endif
@@ -96,7 +96,7 @@
#ifndef atomic_compare_and_exchange_bool_rel
# define atomic_compare_and_exchange_bool_rel(mem, oldval, newval) \
- atomic_compare_and_exchange_bool_acq ((mem), (oldval), (newval))
+ atomic_compare_and_exchange_bool_acq (mem, oldval, newval)
#endif
@@ -190,20 +190,20 @@
#ifndef atomic_add_negative
# define atomic_add_negative(mem, value) \
({ __typeof (value) __aan_value = (value); \
- atomic_exchange_and_add ((mem), __aan_value) < -__aan_value; })
+ atomic_exchange_and_add (mem, __aan_value) < -__aan_value; })
#endif
#ifndef atomic_add_zero
# define atomic_add_zero(mem, value) \
({ __typeof (value) __aaz_value = (value); \
- atomic_exchange_and_add ((mem), __aaz_value) == -__aaz_value; })
+ atomic_exchange_and_add (mem, __aaz_value) == -__aaz_value; })
#endif
#ifndef atomic_bit_set
# define atomic_bit_set(mem, bit) \
- (void) atomic_bit_test_set((mem), (bit))
+ (void) atomic_bit_test_set(mem, bit)
#endif
@@ -231,12 +231,12 @@
#ifndef atomic_read_barrier
-# define atomic_read_barrier() atomic_full_barrier()
+# define atomic_read_barrier() atomic_full_barrier ()
#endif
#ifndef atomic_write_barrier
-# define atomic_write_barrier() atomic_full_barrier()
+# define atomic_write_barrier() atomic_full_barrier ()
#endif
#endif /* atomic.h */
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index d51f837..ad62be8 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -32,6 +32,18 @@
#include <atomic.h>
+/* 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
+
+
/* Internal variables. */
@@ -154,18 +166,6 @@ __do_cancel (void)
#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
-
-
/* Internal prototypes. */
/* Thread list handling. */