[ruby-core:63026] Re: [CommonRuby - Feature #8259] Atomic attributes accessors

From: Joel VanderWerf <joelvanderwerf@...>
Date: 2014-06-09 17:27:46 UTC
List: ruby-core #63026
On 06/09/2014 04:06 AM, Eric Wong wrote:
> I'm not sure if setting the attribute on the ivar is a good way to go.
> Entries in structs, arrays, hashes, etc may also benefit from atomic
> operations (or at least I would like that).
>
> Maybe something like:
>
> 	old = hash["foo"] x= new	# swap
> 	hash["foo"] ?x= old : new	# cas
>

Do you mean that `x` stands for a symbol to be chosen later?

I like this too.

In This Thread