Skip to content

Commit

Permalink
fixup! Add callbacks for when threads start and stop doing work
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed May 28, 2022
1 parent 38e0c87 commit 5a1f189
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rayon-core/src/sleep/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,12 @@ impl Sleep {
// that whomever is coming to wake us will have to wait until we
// release the mutex in the call to `wait`, so they will see this
// boolean as true.)
registry.release_thread();
*is_blocked = true;
while *is_blocked {
is_blocked = sleep_state.condvar.wait(is_blocked).unwrap();
}
registry.acquire_thread();
}

// Update other state:
Expand Down

0 comments on commit 5a1f189

Please sign in to comment.