Skip to content

Commit

Permalink
auto merge of #11204 : alexcrichton/rust/issue-11200, r=cmr
Browse files Browse the repository at this point in the history
Turns out when you grab an OS mutex, you need to be careful about when and where
things are scheduled!

I've confirmed that I could fairly reliably get a deadlock (1 in 100 times ish) before this, and I cannot get a deadlock after this (after 1000+ runs).

Closes #11200
  • Loading branch information
bors committed Dec 30, 2013
2 parents aa5d779 + b27c53b commit b5b570b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libgreen/sched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ mod test {
drop(handle);

let mut handle = pool.spawn_sched();
handle.send(TaskFromFriend(pool.task(TaskOpts::new(), proc() {
handle.send(PinnedTask(pool.task(TaskOpts::new(), proc() {
// Wait until the other task has its lock
start_po.recv();

Expand Down

0 comments on commit b5b570b

Please # to comment.