summaryrefslogtreecommitdiffstats
path: root/libdimension
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension')
-rw-r--r--libdimension/bench/future.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libdimension/bench/future.c b/libdimension/bench/future.c
index 815def1..5937c3c 100644
--- a/libdimension/bench/future.c
+++ b/libdimension/bench/future.c
@@ -51,7 +51,11 @@ dmnsn_bench_thread(void *ptr)
/* Benchmark the increment operation. */
sandglass_bench_fine(&sandglass, dmnsn_future_increment(future));
printf("dmnsn_future_increment(): %ld\n", sandglass.grains);
- future->progress = 0;
+
+ /* Reset the progress. */
+ dmnsn_lock_mutex(&future->mutex);
+ future->progress = 0;
+ dmnsn_unlock_mutex(&future->mutex);
/* Now run a bunch of increments concurrently. */
return dmnsn_execute_concurrently(&dmnsn_bench_future, future, nthreads);