Skip to content

Commit 9c4ba84

Browse files
committed
---
yaml --- r: 6254 b: refs/heads/master c: 07771ec h: refs/heads/master v: v3
1 parent a287734 commit 9c4ba84

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: fcdb313bd5a37ee36247cc608d01387c7456657a
2+
refs/heads/master: 07771ec25bc394a4a053252a2b5441f3160a0568

trunk/src/rt/rust_task.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,20 @@ void task_start_wrapper(spawn_args *a)
191191
task->free(env);
192192
}
193193

194+
task->die();
195+
196+
if (task->killed && !failed) {
197+
LOG(task, task, "Task killed during termination");
198+
failed = true;
199+
}
200+
194201
if (failed) {
195202
#ifndef __WIN32__
196203
task->conclude_failure();
197204
#else
198205
A(task->sched, false, "Shouldn't happen");
199206
#endif
200207
} else {
201-
task->die();
202208
task->lock.lock();
203209
task->notify_tasks_waiting_to_join();
204210
task->lock.unlock();
@@ -316,13 +322,13 @@ rust_task::fail() {
316322
#ifndef __WIN32__
317323
throw this;
318324
#else
325+
die();
319326
conclude_failure();
320327
#endif
321328
}
322329

323330
void
324331
rust_task::conclude_failure() {
325-
die();
326332
// Unblock the task so it can unwind.
327333
unblock();
328334
fail_parent();

trunk/src/test/run-fail/spawnfail.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
// xfail-test
1+
// xfail-win32
22
// error-pattern:explicit
33
use std;
44
import std::task;
55

66
// We don't want to see any invalid reads
77
fn main() {
8-
fn f() {
8+
fn f(&&_i: ()) {
99
fail;
1010
}
11-
let g = f;
12-
task::spawn(g);
11+
task::spawn((), f);
1312
}

0 commit comments

Comments
 (0)