[PATCH 3/7] Remove atomic_bit_set/bit_test_set
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Wed Jul 6 18:59:57 GMT 2022
Hi Noah,
> > - if (atomic_bit_test_set (&pd->cancelhandling, TERMINATED_BIT) == 0)
> > + if ((atomic_fetch_or_acquire (&pd->cancelhandling, 1 << TERMINATED_BIT)
> > + & (1 << TERMINATED_BIT)) == 0)
> Can these remain macros that setup the bit_test_set properly but
> use compiler intrinsics?
The fetch_or above is already written in a way that allows GCC to recognize it
(it's identical to your do_atomic_or0), so I don't see any issue here. However
there is a TERMINATED_BITMASK which might make it more readable.
Cheers,
Wilco
More information about the Libc-alpha
mailing list