aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/distribution.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-08-11 10:22:56 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-08-11 11:48:40 +0200
commitd25f23805c6d7128b508a359d47af136dd2fd0db (patch)
treef0fa7998db9f58a475d8e54f17239aa7822be254 /src/solvers/distribution.h
parent9c5c7af7abe9e444210ac86b903eee775fc76a84 (diff)
downloadnissy-core-d25f23805c6d7128b508a359d47af136dd2fd0db.tar.gz
nissy-core-d25f23805c6d7128b508a359d47af136dd2fd0db.zip
Wrapped pthread use in custom API
Diffstat (limited to 'src/solvers/distribution.h')
-rw-r--r--src/solvers/distribution.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/solvers/distribution.h b/src/solvers/distribution.h
index 27b72d7..4cb7157 100644
--- a/src/solvers/distribution.h
+++ b/src/solvers/distribution.h
@@ -43,7 +43,7 @@ getdistribution(
43 const tableinfo_t info[static 1] 43 const tableinfo_t info[static 1]
44) { 44) {
45 getdistribution_data_t targ[THREADS]; 45 getdistribution_data_t targ[THREADS];
46 pthread_t thread[THREADS]; 46 wrapthread_define_var_thread_t(thread[THREADS]);
47 uint8_t pval, k; 47 uint8_t pval, k;
48 uint64_t local_distr[THREADS][INFO_DISTRIBUTION_LEN]; 48 uint64_t local_distr[THREADS][INFO_DISTRIBUTION_LEN];
49 uint64_t i, j, nbytes, sz, epb; 49 uint64_t i, j, nbytes, sz, epb;
@@ -60,12 +60,12 @@ getdistribution(
60 .distr = local_distr[i], 60 .distr = local_distr[i],
61 .table = table, 61 .table = table,
62 }; 62 };
63 pthread_create(&thread[i], NULL, 63 wrapthread_create(&thread[i], NULL,
64 getdistribution_runthread, &targ[i]); 64 getdistribution_runthread, &targ[i]);
65 } 65 }
66 66
67 for (i = 0; i < THREADS; i++) 67 for (i = 0; i < THREADS; i++)
68 pthread_join(thread[i], NULL); 68 wrapthread_join(thread[i], NULL);
69 69
70 memset(distr, 0, INFO_DISTRIBUTION_LEN * sizeof(uint64_t)); 70 memset(distr, 0, INFO_DISTRIBUTION_LEN * sizeof(uint64_t));
71 for (i = 0; i < THREADS; i++) 71 for (i = 0; i < THREADS; i++)

Generated with cgit - Back to sebastiano.tronto.net