From e68606ff95db6e31585706278b034250555bbe14 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sun, 1 Mar 2026 16:26:58 +0000 Subject: C11 threads? --- src/solvers/distribution.h | 4 ++-- src/solvers/h48/distribution_h48.h | 4 ++-- src/solvers/h48/gendata_h48.h | 8 ++++---- src/solvers/h48/solve.h | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/solvers') diff --git a/src/solvers/distribution.h b/src/solvers/distribution.h index e9302da..7adc964 100644 --- a/src/solvers/distribution.h +++ b/src/solvers/distribution.h @@ -60,12 +60,12 @@ getdistribution( .distr = local_distr[i], .table = table, }; - wrapthread_create(&thread[i], NULL, + wrapthread_create(&thread[i], getdistribution_runthread, &targ[i]); } for (i = 0; i < THREADS; i++) - wrapthread_join(thread[i], NULL); + wrapthread_join(thread[i]); memset(distr, 0, INFO_DISTRIBUTION_LEN * sizeof(uint64_t)); for (i = 0; i < THREADS; i++) diff --git a/src/solvers/h48/distribution_h48.h b/src/solvers/h48/distribution_h48.h index 93a6933..6d50ae5 100644 --- a/src/solvers/h48/distribution_h48.h +++ b/src/solvers/h48/distribution_h48.h @@ -58,12 +58,12 @@ getdistribution_h48( .distr = local_distr[i], .table = table, }; - wrapthread_create(&thread[i], NULL, + wrapthread_create(&thread[i], getdistribution_h48_runthread, &targ[i]); } for (i = 0; i < THREADS; i++) - wrapthread_join(thread[i], NULL); + wrapthread_join(thread[i]); memset(distr, 0, INFO_DISTRIBUTION_LEN * sizeof(uint64_t)); for (i = 0; i < THREADS; i++) diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h index ef8a854..a5bb331 100644 --- a/src/solvers/h48/gendata_h48.h +++ b/src/solvers/h48/gendata_h48.h @@ -230,9 +230,9 @@ gendata_h48_maintable(gendata_h48_arg_t arg[static 1]) inext = 0; count = 0; - wrapthread_mutex_init(&shortcubes_mutex, NULL); + wrapthread_mutex_init(&shortcubes_mutex); for (i = 0; i < CHUNKS; i++) - wrapthread_mutex_init(&table_mutex[i], NULL); + wrapthread_mutex_init(&table_mutex[i]); for (i = 0; i < THREADS; i++) { dfsarg[i] = (h48_dfs_arg_t){ .h = arg->h, @@ -251,7 +251,7 @@ gendata_h48_maintable(gendata_h48_arg_t arg[static 1]) dfsarg[i].table_mutex[ii] = &table_mutex[ii]; wrapthread_create( - &thread[i], NULL, gendata_h48_runthread, &dfsarg[i]); + &thread[i], gendata_h48_runthread, &dfsarg[i]); } if (NISSY_CANSLEEP) { @@ -281,7 +281,7 @@ gendata_h48_maintable(gendata_h48_arg_t arg[static 1]) } for (i = 0; i < THREADS; i++) - wrapthread_join(thread[i], NULL); + wrapthread_join(thread[i]); h48map_destroy(&shortcubes); diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index 15ac6ea..19aaf79 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h @@ -638,7 +638,7 @@ solve_h48( } - wrapthread_mutex_init(&solutions_mutex, NULL); + wrapthread_mutex_init(&solutions_mutex); mtarg = (dfsarg_solve_h48_maketasks_t) { .cube = oc.cube, @@ -689,7 +689,7 @@ solve_h48( arg[i].target_depth = d; arg[i].thread_done = false; wrapthread_create( - &thread[i], NULL, solve_h48_runthread, &arg[i]); + &thread[i], solve_h48_runthread, &arg[i]); } /* Log solutions and handle pause / stop / resume */ @@ -718,7 +718,7 @@ solve_h48( } for (i = 0; i < threads; i++) - wrapthread_join(thread[i], NULL); + wrapthread_join(thread[i]); solve_h48_log_solutions(&sollist, lastused); lastused = sollist.used; -- cgit v1.3