diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-11-11 14:19:15 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-11-11 14:20:00 -0800 |
| commit | 07771ec25bc394a4a053252a2b5441f3160a0568 (patch) | |
| tree | a958cba4203bdc4c276f4c1d4f1889b9491a3cb5 /src/rt/rust_task.cpp | |
| parent | fcdb313bd5a37ee36247cc608d01387c7456657a (diff) | |
| download | rust-07771ec25bc394a4a053252a2b5441f3160a0568.tar.gz rust-07771ec25bc394a4a053252a2b5441f3160a0568.zip | |
Fix run-fail/spawnfail
Catch the case where a parent is killed immediately before it terminates normally.
Diffstat (limited to 'src/rt/rust_task.cpp')
| -rw-r--r-- | src/rt/rust_task.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index 9c2d8824b34..5164f6ac181 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -191,6 +191,13 @@ void task_start_wrapper(spawn_args *a) task->free(env); } + task->die(); + + if (task->killed && !failed) { + LOG(task, task, "Task killed during termination"); + failed = true; + } + if (failed) { #ifndef __WIN32__ task->conclude_failure(); @@ -198,7 +205,6 @@ void task_start_wrapper(spawn_args *a) A(task->sched, false, "Shouldn't happen"); #endif } else { - task->die(); task->lock.lock(); task->notify_tasks_waiting_to_join(); task->lock.unlock(); @@ -316,13 +322,13 @@ rust_task::fail() { #ifndef __WIN32__ throw this; #else + die(); conclude_failure(); #endif } void rust_task::conclude_failure() { - die(); // Unblock the task so it can unwind. unblock(); fail_parent(); |
