Skip to content

Commit bb08ffb

Browse files
committed
Refactor task failure a bit
Issue #236
1 parent 1339d05 commit bb08ffb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/rt/rust_task.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ rust_task::fail() {
244244
// See note in ::kill() regarding who should call this.
245245
DLOG(sched, task, "task %s @0x%" PRIxPTR " failing", name, this);
246246
backtrace();
247+
die();
247248
// Unblock the task so it can unwind.
248249
unblock();
249250
if (supervisor) {
@@ -257,6 +258,8 @@ rust_task::fail() {
257258
if (NULL == supervisor && propagate_failure)
258259
sched->fail();
259260
failed = true;
261+
notify_tasks_waiting_to_join();
262+
yield(4);
260263
}
261264

262265
void

src/rt/rust_upcall.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ upcall_fail(rust_task *task,
9292
size_t line) {
9393
LOG_UPCALL_ENTRY(task);
9494
LOG_ERR(task, upcall, "upcall fail '%s', %s:%" PRIdPTR, expr, file, line);
95-
task->die();
9695
task->fail();
97-
task->notify_tasks_waiting_to_join();
98-
task->yield(4);
9996
}
10097

10198
/**

0 commit comments

Comments
 (0)