Keep the thread set after the task ends
Allows the emulator to check when an inner task ends the next in the stack has the same thread as before.
This commit is contained in:
parent
b0e25f29c7
commit
c40348e2a8
3
emu.h
3
emu.h
@ -117,6 +117,9 @@ struct nosv_task_type {
|
||||
struct nosv_task {
|
||||
uint32_t id;
|
||||
struct nosv_task_type *type;
|
||||
|
||||
/* The thread that has began to execute the task. It cannot
|
||||
* change after being set, even if the task ends. */
|
||||
struct ovni_ethread *thread;
|
||||
enum nosv_task_state state;
|
||||
UT_hash_handle hh;
|
||||
|
@ -231,7 +231,9 @@ pre_task_end(struct ovni_emu *emu)
|
||||
die("task is assigned to a different thread\n");
|
||||
|
||||
task->state = TASK_ST_DEAD;
|
||||
task->thread = NULL;
|
||||
|
||||
/* Don't unset the thread from the task, as it will be used
|
||||
* later to ensure we switch to tasks of the same thread. */
|
||||
|
||||
DL_DELETE(emu->cur_thread->task_stack, task);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user