diff options
| author | Flaper Fesp <flaper87@gmail.com> | 2013-08-18 18:07:20 +0200 |
|---|---|---|
| committer | Flaper Fesp <flaper87@gmail.com> | 2013-08-27 00:34:17 +0200 |
| commit | c4093b4a83dc1660257c88ca7834c46530010985 (patch) | |
| tree | 1f0493d8be4ddcb2929a1c4e8453bade1cff7275 /src/libstd/task | |
| parent | cd92d2c77fe420568045bdc41b4acc4265408eb7 (diff) | |
| download | rust-c4093b4a83dc1660257c88ca7834c46530010985.tar.gz rust-c4093b4a83dc1660257c88ca7834c46530010985.zip | |
Testing rekillable fails when called from outside an unkillable block
Diffstat (limited to 'src/libstd/task')
| -rw-r--r-- | src/libstd/task/mod.rs | 18 |
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 |
