From 1272e304b6367c7dd94d25acf88b2843adabb93a Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sat, 5 Oct 2024 23:00:08 +0200 Subject: Fix rare data race I had some misconception about how _Atomic and const worked. This means the previous commit (expected distribution) could be incorrect. --- src/solvers/h48/gendata_cocsep.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/solvers/h48/gendata_cocsep.h') diff --git a/src/solvers/h48/gendata_cocsep.h b/src/solvers/h48/gendata_cocsep.h index a8142b4..fd483ce 100644 --- a/src/solvers/h48/gendata_cocsep.h +++ b/src/solvers/h48/gendata_cocsep.h @@ -5,7 +5,8 @@ STATIC size_t gendata_cocsep(void *, uint64_t *, cube_t *); STATIC uint32_t gendata_cocsep_dfs(cocsep_dfs_arg_t *); STATIC void getdistribution_cocsep(const uint32_t *, uint64_t [static 21]); -STATIC_INLINE int8_t get_h48_cdata(cube_t, const uint32_t *, uint32_t *); +STATIC_INLINE int8_t get_h48_cdata( + cube_t, _Atomic const uint32_t *, uint32_t *); /* Each element of the cocsep table is a uint32_t used as follows: @@ -158,7 +159,7 @@ set_visited(uint8_t *a, int64_t i) } STATIC_INLINE int8_t -get_h48_cdata(cube_t cube, const uint32_t *cocsepdata, uint32_t *cdata) +get_h48_cdata(cube_t cube, _Atomic const uint32_t *cocsepdata, uint32_t *cdata) { int64_t coord; -- cgit v1.3