*/
Data* read() {
Data *res = data.load(memory_order_acquire);
- load_32(&res->data1);
+ //load_32(&res->data1);
/**
@Begin
@Commit_point_define_check: true
@End
*/
Data* write(int d1, int d2, int d3) {
- Data *prev = data.load(memory_order_acquire);
bool succ = false;
Data *tmp = (Data*) malloc(sizeof(Data));
do {
- store_32(&tmp->data1, prev->data1 + d1);
- //tmp->data1 = prev->data1 + d1;
+ Data *prev = data.load(memory_order_acquire);
+ //store_32(&tmp->data1, prev->data1 + d1);
+ tmp->data1 = prev->data1 + d1;
tmp->data2 = prev->data2 + d2;
tmp->data3 = prev->data3 + d3;
succ = data.compare_exchange_strong(prev, tmp,
- memory_order_acq_rel, memory_order_acquire);
+ memory_order_acq_rel, memory_order_relaxed);
/**
@Begin
@Commit_point_define_check: succ