Skip to content

Commit

Permalink
add comment to start discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
BraulioVM committed Dec 12, 2021
1 parent 4b6bb1d commit 78931cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tokio/src/runtime/blocking/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ impl Inner {
shared.num_idle += 1;

while !shared.shutdown {
// NOTE: A task spawned by spawn_blocking if:
// 1. It is spawned (thus the `condvar` gets a `notify_one`)
// 2. `shutdown` is called and manages to acquire the `shared.lock` *before* the
// thread woken up here gets a hold of it. Then `shutdown` will be true.
let lock_result = self.condvar.wait_timeout(shared, self.keep_alive).unwrap();

shared = lock_result.0;
Expand Down

0 comments on commit 78931cc

Please sign in to comment.