about summary refs log tree commit diff
path: root/src/libstd/task
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/task')
-rw-r--r--src/libstd/task/mod.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs
index bac4991d858..c66296723b1 100644
--- a/src/libstd/task/mod.rs
+++ b/src/libstd/task/mod.rs
@@ -598,7 +598,8 @@ pub fn unkillable<U>(f: &fn() -> U) -> U {
 }
 
 /**
- * Makes killable a task marked as unkillable
+ * Makes killable a task marked as unkillable. This
+ * is meant to be used only nested in unkillable.
  *
  * # Example
  *
@@ -607,6 +608,7 @@ pub fn unkillable<U>(f: &fn() -> U) -> U {
  *     do task::rekillable {
  *          // Task is killable
  *     }
+ *    // Task is unkillable again
  * }
  */
 pub fn rekillable<U>(f: &fn() -> U) -> U {
@@ -1237,6 +1239,20 @@ fn test_unkillable_nested() {
     po.recv();
 }
 
+#[ignore(reason = "linked failure")]
+#[test]
+#[ignore(cfg(windows))]
+#[should_fail]
+fn test_rekillable_not_nested() {
+    do rekillable {
+        // This should fail before
+        // receiving anything since
+        // this block should be nested
+        // into a unkillable block.
+        yield();
+    }
+}
+
 #[test]
 fn test_child_doesnt_ref_parent() {
     // If the child refcounts the parent task, this will stack overflow when