Skip to content

Commit

Permalink
Change the profiler loop to use try_recv so that the task
Browse files Browse the repository at this point in the history
will exit during shutdown instead of crashing trying to
recv on a closed port.
  • Loading branch information
larsbergstrom committed Aug 23, 2013
1 parent a074267 commit ecfa798
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/util/time.rs
Expand Up @@ -131,8 +131,11 @@ impl Profiler {

pub fn start(&mut self) {
loop {
let msg = self.port.recv();
self.handle_msg(msg);
let msg = self.port.try_recv();
match msg {
Some (msg) => self.handle_msg(msg),
None => break
}
}
}

Expand Down

5 comments on commit ecfa798

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jdm
at larsbergstrom@ecfa798

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging larsbergstrom/servo/profile-chan-fix = ecfa798 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

larsbergstrom/servo/profile-chan-fix = ecfa798 merged ok, testing candidate = d70178d

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = d70178d

Please sign in to comment.