File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 77#include < random.h>
88#include < util/time.h>
99
10+ #include < atomic>
1011#include < iostream>
1112
1213static void BuildTestVectors (size_t count, size_t invalidCount,
@@ -314,9 +315,9 @@ static void BLS_Verify_BatchedParallel(benchmark::Bench& bench)
314315
315316 std::list<std::pair<size_t , std::future<bool >>> futures;
316317
317- volatile bool cancel = false ;
318- auto cancelCond = [&]() {
319- return cancel;
318+ std::atomic< bool > cancel{ false } ;
319+ auto cancelCond = [&]() -> bool {
320+ return cancel. load () ;
320321 };
321322
322323 CBLSWorker blsWorker;
@@ -348,7 +349,7 @@ static void BLS_Verify_BatchedParallel(benchmark::Bench& bench)
348349 }
349350 });
350351
351- cancel = true ;
352+ cancel. store ( true ) ;
352353 while (blsWorker.IsAsyncVerifyInProgress ())
353354 {
354355 UninterruptibleSleep (std::chrono::milliseconds{100 });
You can’t perform that action at this time.
0 commit comments