Skip to content

Commit

Permalink
Fix an earlier fix to algorithm::traverse, where the earlier fix was …
Browse files Browse the repository at this point in the history
…obviously broken.
  • Loading branch information
ned14 committed May 11, 2021
1 parent aaac3b0 commit bfef269
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/llfio/v2.0/detail/impl/traverse.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,11 @@ namespace algorithm
state.threads_sleeping++;
maincond.notify_all();
cond.wait(g);
state.threads_sleeping--;
if(done)
{
break;
}
state.threads_sleeping--;
}
else
{
Expand All @@ -441,6 +441,7 @@ namespace algorithm
break;
}
}
state.threads_sleeping++;
state.threads_running--;
maincond.notify_all();
},
Expand All @@ -449,7 +450,7 @@ namespace algorithm
}
{
std::unique_lock<std::mutex> g(state.lock);
while(state.threads_sleeping < threads)
while(state.threads_sleeping < threads && !done)
{
maincond.wait(g);
}
Expand Down

0 comments on commit bfef269

Please sign in to comment.