This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCHv4] powerpc: Fix write-after-destroy in lock elision


Tulio Magno Quites Machado Filho wrote:

> +      /* Update adapt_count in the critical section to prevent a
> +	 write-after-destroy error as mentioned in BZ 20822.  The
> +	 following update of adapt_count has to be contained within
> +	 the critical region of the fall-back lock in order to not violate
> +	 the mutex destruction requirements.  */
> +      short __tmp = atomic_load_relaxed (adapt_count);
> +      if (__tmp > 0)
> +        atomic_store_relaxed (adapt_count, __tmp--);

Doesn't this have to be --__tmp to have any effect?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]