int t2=atomic_fetch_add_explicit(&y, 1, memory_order_release);
printf("t1=%d, t2=%d\n", t1, t2);
}
int t2=atomic_fetch_add_explicit(&y, 1, memory_order_release);
printf("t1=%d, t2=%d\n", t1, t2);
}
- void * ptr=(void *)atomic_load_explicit(&z, memory_order_relaxed);
- atomic_store_explicit(&z2, ptr, memory_order_relaxed);
+ void *ptr = (void *)atomic_load_explicit(&z, memory_order_relaxed);
+ atomic_store_explicit(&z2, (intptr_t)ptr, memory_order_relaxed);
- atomic_init(&z, (long long) &x);
- atomic_init(&z2, (long long) &x);
+ atomic_init(&z, (intptr_t) &x);
+ atomic_init(&z2, (intptr_t) &x);
thrd_create(&t1, (thrd_start_t)&a, NULL);
thrd_create(&t2, (thrd_start_t)&b, NULL);
thrd_create(&t1, (thrd_start_t)&a, NULL);
thrd_create(&t2, (thrd_start_t)&b, NULL);