auto merge of #12302 : alexcrichton/rust/issue-12295, r=brson

The previous code erroneously assumed that 'steals > cnt' was always true, but
that was a false assumption. The code was altered to decrement steals to a
minimum of 0 instead of taking all of cnt into account.

I didn't include the exact test from #12295 because it could run for quite
awhile, and instead set the threshold for MAX_STEALS to much lower during
testing. I found that this triggered the old bug quite frequently when running
without this fix.

Closes #12295
This commit is contained in:
bors
2014-02-15 23:36:26 -08:00
5 changed files with 28 additions and 10 deletions

View File

@@ -65,7 +65,6 @@ use rt::task::Task;
use str::{Str, SendStr, IntoMaybeOwned};
#[cfg(test)] use any::{AnyOwnExt, AnyRefExt};
#[cfg(test)] use ptr;
#[cfg(test)] use result;
/// Indicates the manner in which a task exited.