From 7becd5f3dd88fac3e9e6e81cf7bbd449489557ae Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Thu, 2 Jul 2009 00:39:59 +0200 Subject: [PATCH] The value of process.parent has to be set _before_ the thread starts. --- src/c/threads.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/c/threads.d b/src/c/threads.d index b0bc4c217..1c967e2d6 100644 --- a/src/c/threads.d +++ b/src/c/threads.d @@ -326,16 +326,16 @@ mp_process_enable(cl_object process) if (mp_process_active_p(process) != Cnil) FEerror("Cannot enable the running process ~A.", 1, process); - code = (HANDLE)CreateThread(NULL, 0, thread_entry_point, process, 0, &threadId); process->process.parent = mp_current_process(); + code = (HANDLE)CreateThread(NULL, 0, thread_entry_point, process, 0, &threadId); output = (process->process.thread = code)? process : Cnil; #else int code; if (mp_process_active_p(process) != Cnil) FEerror("Cannot enable the running process ~A.", 1, process); - code = pthread_create(&process->process.thread, NULL, thread_entry_point, process); process->process.parent = mp_current_process(); + code = pthread_create(&process->process.thread, NULL, thread_entry_point, process); output = (process->process.thread = code)? Cnil : process; #endif @(return output)