From f97d3da5c375ac2fc5a9173cdd36cb828915a2e1 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Wed, 30 Dec 2015 13:05:36 -0500 Subject: [PATCH] regressions/ck_sequence: Use flag rather than counter value for first set. Prevents resetting exit barrier on overflow. Otherwise, hangs occur on higher-performing systems. --- regressions/ck_sequence/validate/ck_sequence.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/regressions/ck_sequence/validate/ck_sequence.c b/regressions/ck_sequence/validate/ck_sequence.c index a24ac05..e0bc700 100644 --- a/regressions/ck_sequence/validate/ck_sequence.c +++ b/regressions/ck_sequence/validate/ck_sequence.c @@ -115,6 +115,7 @@ main(int argc, char *argv[]) { pthread_t *threads; unsigned int counter = 0; + bool first = true; int n_threads, i; if (argc != 3) { @@ -154,8 +155,10 @@ main(int argc, char *argv[]) global.c = global.b + global.a; ck_sequence_write_end(&seqlock); - if (counter == 1) + if (first == true) { ck_pr_store_uint(&barrier, n_threads); + first = false; + } counter++; if (ck_pr_load_uint(&barrier) == 0)