Skip to content

Commit fbcf073

Browse files
committed
---
yaml --- r: 14595 b: refs/heads/try c: 1430675 h: refs/heads/master i: 14593: 092b430 14591: b754f0a v: v3
1 parent 2ffc41c commit fbcf073

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 9ec94f714ab4d7175451095dc7438e6a9ee2cc0c
5+
refs/heads/try: 14306756b4a4f5f83043e3c2f91169a151fd54f5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rt/rust_task.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,6 @@ rust_task::delete_this()
121121
I(thread, ref_count == 0); // ||
122122
// (ref_count == 1 && this == sched->root_task));
123123

124-
// Delete all the stacks. There may be more than one if the task failed
125-
// and no landing pads stopped to clean up.
126-
// FIXME: We should do this when the task exits, not in the destructor
127-
while (stk != NULL) {
128-
del_stack();
129-
}
130-
131124
thread->release_task(this);
132125
}
133126

@@ -725,6 +718,16 @@ rust_task::check_stack_canary() {
725718
::check_stack_canary(stk);
726719
}
727720

721+
void
722+
rust_task::delete_all_stacks() {
723+
I(thread, !on_rust_stack());
724+
// Delete all the stacks. There may be more than one if the task failed
725+
// and no landing pads stopped to clean up.
726+
while (stk != NULL) {
727+
del_stack();
728+
}
729+
}
730+
728731
void
729732
rust_task::config_notify(chan_handle chan) {
730733
notify_enabled = true;

branches/try/src/rt/rust_task.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ rust_task : public kernel_owned<rust_task>, rust_cond
205205
void reset_stack_limit();
206206
bool on_rust_stack();
207207
void check_stack_canary();
208+
void delete_all_stacks();
208209

209210
void config_notify(chan_handle chan);
210211

branches/try/src/rt/rust_task_thread.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ rust_task_thread::reap_dead_tasks() {
144144
rust_task *task = dead_tasks_copy[i];
145145
// Release the task from the kernel so nobody else can get at it
146146
kernel->release_task_id(task->id);
147+
task->delete_all_stacks();
147148
// Deref the task, which may cause it to request us to release it
148149
task->deref();
149150
}

0 commit comments

Comments
 (0)