Patch to ensure functions are evaluated immediately.

This patch causes a thread that is created to evaluate a function
to be executed immediately. The parent thread is resumed when the
function thread terminates.
This commit is contained in:
Martin Whitaker 2008-08-15 23:58:59 +01:00 committed by Stephen Williams
parent 1f5b11246e
commit 2c1426a44d
1 changed files with 8 additions and 1 deletions

View File

@ -2076,7 +2076,14 @@ bool of_FORK(vthread_t thr, vvp_code_t cp)
thr->fork_count += 1;
schedule_vthread(child, 0, true);
/* If the new child was created to evaluate a function,
run it immediately, then return to this thread. */
if (cp->scope->base.vpi_type->type_code == vpiFunction) {
child->is_scheduled = 1;
vthread_run(child);
} else {
schedule_vthread(child, 0, true);
}
return true;
}