From 7cb3f3e86a5500ecf40500dc9f6cedabd8e0349e Mon Sep 17 00:00:00 2001 From: Ben Blum Date: Tue, 31 Jul 2012 22:29:59 -0400 Subject: [PATCH] Linked failure: enable unidirectional propagate test; replace FIXMEs with comments (tag #1868). --- src/libcore/task.rs | 13 +++++++------ src/rt/rust_task.cpp | 2 +- src/rt/rust_task.h | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/libcore/task.rs b/src/libcore/task.rs index 60ea14cf637..08ac52e44ff 100644 --- a/src/libcore/task.rs +++ b/src/libcore/task.rs @@ -81,11 +81,13 @@ enum task { task_handle(task_id) } /** * Indicates the manner in which a task exited. * - * A task that completes without failing and whose supervised children - * complete without failing is considered to exit successfully. + * A task that completes without failing is considered to exit successfully. + * Supervised ancestors and linked siblings may yet fail after this task + * succeeds. Also note that in such a case, it may be nondeterministic whether + * linked failure or successful exit happen first. * - * FIXME (See #1868): This description does not indicate the current behavior - * for linked failure. + * If you wish for this result's delivery to block until all linked and/or + * children tasks complete, recommend using a result future. */ enum task_result { success, @@ -1505,8 +1507,7 @@ fn test_spawn_linked_unsup_default_opts() { // parent fails; child fails // A couple bonus linked failure tests - testing for failure propagation even // when the middle task exits successfully early before kill signals are sent. -#[test] #[should_fail] // #[ignore(cfg(windows))] -#[ignore] // FIXME (#1868) (bblum) make this work +#[test] #[should_fail] #[ignore(cfg(windows))] fn test_spawn_failure_propagate_grandchild() { // Middle task exits; does grandparent's failure propagate across the gap? do spawn_supervised { diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index b2f7538b628..061e87ebff8 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -634,7 +634,7 @@ rust_task::on_rust_stack() { void rust_task::inhibit_kill() { scoped_lock with(lifecycle_lock); - // FIXME (#1868) Check here if we have to die + // Here might be good, though not mandatory, to check if we have to die. disallow_kill++; } diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h index 10419686d48..369d84dd065 100644 --- a/src/rt/rust_task.h +++ b/src/rt/rust_task.h @@ -431,10 +431,10 @@ rust_task::call_on_rust_stack(void *args, void *fn_ptr) { assert(get_sp_limit() != 0 && "Stack must be configured"); assert(next_rust_sp); - bool had_reentered_rust_stack = reentered_rust_stack; + bool had_reentered_rust_stack; { - // FIXME (#1868) This must be racy. Figure it out. scoped_lock with(lifecycle_lock); + had_reentered_rust_stack = reentered_rust_stack; reentered_rust_stack = true; }