From 113312a0c15704160bb6d3dda1f04e927fa1a17d Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 26 Nov 2008 20:02:01 -0800 Subject: [PATCH] V0.8: do not schedule function calls. This patch mirrors what was done in development to force a function call to be run immediately. --- vvp/vthread.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vvp/vthread.cc b/vvp/vthread.cc index b9803289b..835a0ce3b 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -1380,7 +1380,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; }