On Fri, Jun 24, 2022 at 10:34 AM Yann Ylavic <ylavic....@gmail.com> wrote:
>
> Daniel proposed in [1] that we introduce apr_atomic_casptr2() to
> resolve the defect in the apr_atomic_casptr() API.
> Namely the correct:
> 1. APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, ...);
> Versus the broken:
> 2. APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, ...);
>
> The problem with 2 is that it does not prevent the compiler from
> caching *mem into a local variable, which would break atomicity.
>
> This is fixed in trunk already where we could change the API to 1, but
> not in 1.x.
> Anyone opposed to the attached patch (for 1.8.x only then)?
>
> Regards;
> Yann.
>
> [1] https://bz.apache.org/bugzilla/show_bug.cgi?id=50731#c2

+1

Reply via email to