auto merge of #11204 : alexcrichton/rust/issue-11200, r=cmr

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
This commit is contained in:
bors 2013-12-29 18:46:57 -08:00
commit b5b570b6be

View File

@ -1433,7 +1433,7 @@ fn test_spawn_sched_blocking() {
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();