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 {
598
598
}
599
599
600
600
/**
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.
602
603
*
603
604
* # Example
604
605
*
@@ -607,6 +608,7 @@ pub fn unkillable<U>(f: &fn() -> U) -> U {
607
608
* do task::rekillable {
608
609
* // Task is killable
609
610
* }
611
+ * // Task is unkillable again
610
612
* }
611
613
*/
612
614
pub fn rekillable < U > ( f : & fn ( ) -> U ) -> U {
@@ -1237,6 +1239,20 @@ fn test_unkillable_nested() {
1237
1239
po. recv ( ) ;
1238
1240
}
1239
1241
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
+
1240
1256
#[ test]
1241
1257
fn test_child_doesnt_ref_parent ( ) {
1242
1258
// If the child refcounts the parent task, this will stack overflow when
You can’t perform that action at this time.
0 commit comments