diff options
| author | Nick Desaulniers <ndesaulniers@mozilla.com> | 2013-01-31 17:51:01 -0800 |
|---|---|---|
| committer | Nick Desaulniers <ndesaulniers@mozilla.com> | 2013-01-31 22:25:12 -0800 |
| commit | 6fb4239bb361a927582a8ffd53a2ae649d810fdf (patch) | |
| tree | 9d0d7284aa54be4b26fc21a38a270904c1159693 /src/libcore/task | |
| parent | adb9d0e8a13131ff3efab6dbb1878774588100fd (diff) | |
| download | rust-6fb4239bb361a927582a8ffd53a2ae649d810fdf.tar.gz rust-6fb4239bb361a927582a8ffd53a2ae649d810fdf.zip | |
Replace most invocations of fail keyword with die! macro
Diffstat (limited to 'src/libcore/task')
| -rw-r--r-- | src/libcore/task/mod.rs | 4 | ||||
| -rw-r--r-- | src/libcore/task/spawn.rs | 30 |
2 files changed, 17 insertions, 17 deletions
diff --git a/src/libcore/task/mod.rs b/src/libcore/task/mod.rs index a34956c87ba..d276f0c6ea9 100644 --- a/src/libcore/task/mod.rs +++ b/src/libcore/task/mod.rs @@ -733,7 +733,7 @@ fn test_spawn_linked_sup_fail_up() { // child fails; parent fails can_not_copy: None, .. b0 }; - do b1.spawn { fail; } + do b1.spawn { die!(); } po.recv(); // We should get punted awake } #[test] #[should_fail] #[ignore(cfg(windows))] @@ -760,7 +760,7 @@ fn test_spawn_linked_sup_fail_down() { // parent fails; child fails fn test_spawn_linked_unsup_fail_up() { // child fails; parent fails let (po, _ch) = stream::<()>(); // Default options are to spawn linked & unsupervised. - do spawn { fail; } + do spawn { die!(); } po.recv(); // We should get punted awake } #[test] #[should_fail] #[ignore(cfg(windows))] diff --git a/src/libcore/task/spawn.rs b/src/libcore/task/spawn.rs index e5fa0db63a1..ce95cdd0205 100644 --- a/src/libcore/task/spawn.rs +++ b/src/libcore/task/spawn.rs @@ -646,25 +646,25 @@ pub fn spawn_raw(opts: TaskOpts, f: fn~()) { fn new_task_in_sched(opts: SchedOpts) -> *rust_task { if opts.foreign_stack_size != None { - fail ~"foreign_stack_size scheduler option unimplemented"; + die!(~"foreign_stack_size scheduler option unimplemented"); } let num_threads = match opts.mode { - DefaultScheduler - | CurrentScheduler - | ExistingScheduler(*) - | PlatformThread => 0u, /* Won't be used */ - SingleThreaded => 1u, - ThreadPerCore => unsafe { rt::rust_num_threads() }, - ThreadPerTask => { - fail ~"ThreadPerTask scheduling mode unimplemented" - } - ManualThreads(threads) => { - if threads == 0u { - fail ~"can not create a scheduler with no threads"; + DefaultScheduler + | CurrentScheduler + | ExistingScheduler(*) + | PlatformThread => 0u, /* Won't be used */ + SingleThreaded => 1u, + ThreadPerCore => unsafe { rt::rust_num_threads() }, + ThreadPerTask => { + die!(~"ThreadPerTask scheduling mode unimplemented") + } + ManualThreads(threads) => { + if threads == 0u { + die!(~"can not create a scheduler with no threads"); + } + threads } - threads - } }; unsafe { |
