Skip to content

Commit d1970c8

Browse files
committed
---
yaml --- r: 21247 b: refs/heads/snap-stage3 c: 47cca22 h: refs/heads/master i: 21245: a6d5a28 21243: 082459a 21239: 32758b2 21231: 5244a24 21215: 5b9a735 21183: 5d0f1d1 21119: 07db184 20991: 96fbb2a v: v3
1 parent 5005cc8 commit d1970c8

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 0229bc4defdaa6bad77269204279ed1a37b3aa9f
4+
refs/heads/snap-stage3: 47cca22d5455d2d60226ead907fd627784701ef5
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libcore/task.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,9 +1473,13 @@ extern mod rustrt {
14731473

14741474
fn rust_task_is_unwinding(task: *rust_task) -> bool;
14751475
fn rust_osmain_sched_id() -> sched_id;
1476+
#[rust_stack]
14761477
fn rust_task_inhibit_kill(t: *rust_task);
1478+
#[rust_stack]
14771479
fn rust_task_allow_kill(t: *rust_task);
1480+
#[rust_stack]
14781481
fn rust_task_inhibit_yield(t: *rust_task);
1482+
#[rust_stack]
14791483
fn rust_task_allow_yield(t: *rust_task);
14801484
fn rust_task_kill_other(task: *rust_task);
14811485
fn rust_task_kill_all(task: *rust_task);

branches/snap-stage3/src/rt/rust_task.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -631,27 +631,29 @@ rust_task::on_rust_stack() {
631631
}
632632
}
633633

634+
// NB: In inhibit_kill and allow_kill, helgrind would complain that we need to
635+
// hold lifecycle_lock while accessing disallow_kill. Even though another
636+
// killing task may access disallow_kill concurrently, this is not racy
637+
// because the killer only cares if this task is blocking, and block() already
638+
// uses proper locking. See https://github.com/mozilla/rust/issues/3213 .
639+
634640
void
635641
rust_task::inhibit_kill() {
636-
scoped_lock with(lifecycle_lock);
637642
// Here might be good, though not mandatory, to check if we have to die.
638643
disallow_kill++;
639644
}
640645

641646
void
642647
rust_task::allow_kill() {
643-
scoped_lock with(lifecycle_lock);
644648
assert(disallow_kill > 0 && "Illegal allow_kill(): already killable!");
645649
disallow_kill--;
646650
}
647651

648652
void rust_task::inhibit_yield() {
649-
scoped_lock with(lifecycle_lock);
650653
disallow_yield++;
651654
}
652655

653656
void rust_task::allow_yield() {
654-
scoped_lock with(lifecycle_lock);
655657
assert(disallow_yield > 0 && "Illegal allow_yield(): already yieldable!");
656658
disallow_yield--;
657659
}

0 commit comments

Comments
 (0)