File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -598,7 +598,8 @@ pub fn unkillable<U>(f: &fn() -> U) -> U {
598598}
599599
600600/**
601- * Makes killable a task marked as unkillable
601+ * Makes killable a task marked as unkillable. This
602+ * is meant to be used only nested in unkillable.
602603 *
603604 * # Example
604605 *
@@ -607,6 +608,7 @@ pub fn unkillable<U>(f: &fn() -> U) -> U {
607608 * do task::rekillable {
608609 * // Task is killable
609610 * }
611+ * // Task is unkillable again
610612 * }
611613 */
612614pub fn rekillable < U > ( f : & fn ( ) -> U ) -> U {
@@ -1237,6 +1239,20 @@ fn test_unkillable_nested() {
12371239 po. recv ( ) ;
12381240}
12391241
1242+ #[ ignore( reason = "linked failure" ) ]
1243+ #[ test]
1244+ #[ ignore( cfg( windows) ) ]
1245+ #[ should_fail]
1246+ fn test_rekillable_not_nested ( ) {
1247+ do rekillable {
1248+ // This should fail before
1249+ // receiving anything since
1250+ // this block should be nested
1251+ // into a unkillable block.
1252+ yield( ) ;
1253+ }
1254+ }
1255+
12401256#[ test]
12411257fn test_child_doesnt_ref_parent ( ) {
12421258 // If the child refcounts the parent task, this will stack overflow when
You can’t perform that action at this time.
0 commit comments