File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -223,17 +223,19 @@ null_dep = dependency('', required : false)
223
223
atomic_dep = null_dep
224
224
code_non_lockfree = '''
225
225
#include <stdint.h>
226
+ #include <stddef.h>
227
+ #include <stdatomic.h>
226
228
int main() {
227
229
struct {
228
230
void *p;
229
231
uint8_t u8v;
230
232
} x;
231
233
x.p = NULL;
232
234
x.u8v = 0;
233
- uint8_t res = __atomic_load_n(x.u8v, __ATOMIC_SEQ_CST);
234
- __atomic_store_n(x.u8v, 1, ATOMIC_SEQ_CST );
235
- void *p = __atomic_load_n(x.p, __ATOMIC_SEQ_CST);
236
- __atomic_store_n((void **)x.p, NULL, __ATOMIC_SEQ_CST)
235
+ uint8_t res = __atomic_load_n(& x.u8v, __ATOMIC_SEQ_CST);
236
+ __atomic_store_n(& x.u8v, 1, __ATOMIC_SEQ_CST );
237
+ void *p = __atomic_load_n((void **) x.p, __ATOMIC_SEQ_CST);
238
+ __atomic_store_n((void **)x.p, NULL, __ATOMIC_SEQ_CST);
237
239
return 0;
238
240
}
239
241
'''
You can’t perform that action at this time.
0 commit comments