1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // xfail-test linked failure
14 // Create a task that is supervised by another task, join the supervised task
15 // from the supervising task, then fail the supervised task. The supervised
16 // task will kill the supervising task, waking it up. The supervising task no
17 // longer needs to be wakened when the supervised task exits.
22 // Yield to make sure the supervisor joins before we fail. This is
23 // currently not needed because the supervisor runs first, but I can
24 // imagine that changing.
30 // Unsupervise this task so the process doesn't return a failure status as
31 // a result of the main task being killed.
33 task::try(supervised);
37 task::spawn_unlinked(supervisor)