On 18/05/2016 16:10, Sergey Fedorov wrote:
> On 18/05/16 17:05, Paolo Bonzini wrote:
>> this:
>>
>>   if (atomic_read(&x) != 1) {
>>     atomic_set(&x, 1);
>>   }
>>
>> couldn't become an unconditional
>>
>>   atomic_set(&x, 1);
> 
> Sorry, I can't figure out why it couldn't...

Because atomics cannot create new unconditional writes (and neither can
volatile).

Thanks,

paolo

Reply via email to