]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 5 Feb 2003 07:10:33 +0000 (07:10 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 5 Feb 2003 07:10:33 +0000 (07:10 +0000)
* atomic.h (atomic_compare_and_exchange_acq): Use
__arch_compare_and_exchange_32_acq in return value definition.  It
always exists.
(atomic_bit_set): Renamed from atomic_set_bit.

nptl/ChangeLog
nptl/atomic.h

index 542b102f788a025a88dc6f3a7956372eacfe004b..f018cccbb3a6f9a7daab5541209fc59ae6aa5ddb 100644 (file)
@@ -1,6 +1,9 @@
 2003-02-04  Ulrich Drepper  <drepper@redhat.com>
 
-       * atomic.h (atomic_bit_set): Renamed from atomic_set_bit.
+       * atomic.h (atomic_compare_and_exchange_acq): Use
+       __arch_compare_and_exchange_32_acq in return value definition.  It
+       always exists.
+       (atomic_bit_set): Renamed from atomic_set_bit.
        Add missing atomic_ prefixes.
 
        * sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
index fe390ddf7861c6401294513becec7a1442ce7113..c8ea95f8340131480a0a42ff3ca3c87cb0fed29b 100644 (file)
@@ -27,7 +27,7 @@
 
 #ifndef atomic_compare_and_exchange_acq
 # define atomic_compare_and_exchange_acq(mem, newval, oldval) \
-  ({ __typeof (__arch_compare_and_exchange_8_acq (mem, newval, oldval))              \
+  ({ __typeof (__arch_compare_and_exchange_32_acq (mem, newval, oldval))      \
         __result;                                                            \
      if (sizeof (*mem) == 1)                                                 \
        __result = __arch_compare_and_exchange_8_acq (mem, newval, oldval);    \
 #ifndef atomic_bit_set
 # define atomic_bit_set(mem, bit) \
   (void) ({ __typeof (mem) __memp = (mem);                                   \
-           while (1)                                                         \
-             {                                                               \
-               __typeof (*mem) __oldval = *__memp;                           \
+           __typeof (*mem) __mask = (1 << (bit));                            \
+           __typeof (*mem) __oldval;                                         \
                                                                              \
-               if (atomic_compare_and_exchange_acq (__memp,                  \
-                                                    __oldval | 1 << bit,     \
-                                                    __oldval) == 0)          \
-                 break;                                                      \
+           do                                                                \
+             __oldval = *__memp;                                             \
+            while (atomic_compare_and_exchange_acq (__memp,                  \
+                                                    __oldval | __mask,       \
+                                                    __oldval));              \
              }})
 #endif