Skip to content

Commit 7cb3f3e

Browse files
committed
Linked failure: enable unidirectional propagate test; replace FIXMEs with comments (tag #1868).
1 parent 43b8114 commit 7cb3f3e

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/libcore/task.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ enum task { task_handle(task_id) }
8181
/**
8282
* Indicates the manner in which a task exited.
8383
*
84-
* A task that completes without failing and whose supervised children
85-
* complete without failing is considered to exit successfully.
84+
* A task that completes without failing is considered to exit successfully.
85+
* Supervised ancestors and linked siblings may yet fail after this task
86+
* succeeds. Also note that in such a case, it may be nondeterministic whether
87+
* linked failure or successful exit happen first.
8688
*
87-
* FIXME (See #1868): This description does not indicate the current behavior
88-
* for linked failure.
89+
* If you wish for this result's delivery to block until all linked and/or
90+
* children tasks complete, recommend using a result future.
8991
*/
9092
enum task_result {
9193
success,
@@ -1505,8 +1507,7 @@ fn test_spawn_linked_unsup_default_opts() { // parent fails; child fails
15051507
// A couple bonus linked failure tests - testing for failure propagation even
15061508
// when the middle task exits successfully early before kill signals are sent.
15071509

1508-
#[test] #[should_fail] // #[ignore(cfg(windows))]
1509-
#[ignore] // FIXME (#1868) (bblum) make this work
1510+
#[test] #[should_fail] #[ignore(cfg(windows))]
15101511
fn test_spawn_failure_propagate_grandchild() {
15111512
// Middle task exits; does grandparent's failure propagate across the gap?
15121513
do spawn_supervised {

src/rt/rust_task.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ rust_task::on_rust_stack() {
634634
void
635635
rust_task::inhibit_kill() {
636636
scoped_lock with(lifecycle_lock);
637-
// FIXME (#1868) Check here if we have to die
637+
// Here might be good, though not mandatory, to check if we have to die.
638638
disallow_kill++;
639639
}
640640

src/rt/rust_task.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,10 @@ rust_task::call_on_rust_stack(void *args, void *fn_ptr) {
431431
assert(get_sp_limit() != 0 && "Stack must be configured");
432432
assert(next_rust_sp);
433433

434-
bool had_reentered_rust_stack = reentered_rust_stack;
434+
bool had_reentered_rust_stack;
435435
{
436-
// FIXME (#1868) This must be racy. Figure it out.
437436
scoped_lock with(lifecycle_lock);
437+
had_reentered_rust_stack = reentered_rust_stack;
438438
reentered_rust_stack = true;
439439
}
440440

0 commit comments

Comments
 (0)