mirror of git://sourceware.org/git/glibc.git
Update.
* 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.
This commit is contained in:
parent
0289bef9a6
commit
d45e874013
|
@ -1,6 +1,9 @@
|
||||||
2003-02-04 Ulrich Drepper <drepper@redhat.com>
|
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.
|
Add missing atomic_ prefixes.
|
||||||
|
|
||||||
* sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
|
* sysdeps/pthread/bits/libc-lock.h (__libc_once): In case no
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
#ifndef atomic_compare_and_exchange_acq
|
#ifndef atomic_compare_and_exchange_acq
|
||||||
# define atomic_compare_and_exchange_acq(mem, newval, oldval) \
|
# 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; \
|
__result; \
|
||||||
if (sizeof (*mem) == 1) \
|
if (sizeof (*mem) == 1) \
|
||||||
__result = __arch_compare_and_exchange_8_acq (mem, newval, oldval); \
|
__result = __arch_compare_and_exchange_8_acq (mem, newval, oldval); \
|
||||||
|
@ -82,14 +82,14 @@
|
||||||
#ifndef atomic_bit_set
|
#ifndef atomic_bit_set
|
||||||
# define atomic_bit_set(mem, bit) \
|
# define atomic_bit_set(mem, bit) \
|
||||||
(void) ({ __typeof (mem) __memp = (mem); \
|
(void) ({ __typeof (mem) __memp = (mem); \
|
||||||
while (1) \
|
__typeof (*mem) __mask = (1 << (bit)); \
|
||||||
{ \
|
__typeof (*mem) __oldval; \
|
||||||
__typeof (*mem) __oldval = *__memp; \
|
|
||||||
\
|
\
|
||||||
if (atomic_compare_and_exchange_acq (__memp, \
|
do \
|
||||||
__oldval | 1 << bit, \
|
__oldval = *__memp; \
|
||||||
__oldval) == 0) \
|
while (atomic_compare_and_exchange_acq (__memp, \
|
||||||
break; \
|
__oldval | __mask, \
|
||||||
|
__oldval)); \
|
||||||
}})
|
}})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue