We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92f60f4 commit 43fecf3Copy full SHA for 43fecf3
src/libstd/rt/sched.rs
@@ -540,6 +540,10 @@ impl Scheduler {
540
// The current task is grabbed from TLS, not taken as an input.
541
let current_task: ~Task = Local::take::<Task>();
542
543
+ // Check that the task is not in an atomically() section (e.g.,
544
+ // holding a pthread mutex, which could deadlock the scheduler).
545
+ current_task.death.assert_may_sleep();
546
+
547
// These transmutes do something fishy with a closure.
548
let f_fake_region = unsafe {
549
transmute::<&fn(&mut Scheduler, ~Task),
0 commit comments