Run all managed code in a subthread. Re-enable GC threaded finalisation.
authorDick Porter <dick@acm.org>
Thu, 23 Jan 2003 17:46:26 +0000 (17:46 -0000)
committerDick Porter <dick@acm.org>
Thu, 23 Jan 2003 17:46:26 +0000 (17:46 -0000)
commit9b5c149aec6d102a015c353b28fee08a1bae4009
treeab1012cf0886c0568830d959c05d7f963b1e280b
parent7f33ba9dd9a59ace37074d17387e9524c074c930
Run all managed code in a subthread.  Re-enable GC threaded finalisation.
Fixes bugs 34263 and 31333.

(All tests still behave the same way - 4 fails)

2003-01-23  Dick Porter  <dick@ximian.com>

* threads.c (start_wrapper): Create a Thread object if needed, so
the Main() thread can do the class initialisation in a subthread
that has been set up to allow managed code execution.

Pass the thread ID instead of the MonoThread pointer to the thread
start and attach callbacks.  This change is required, because the
jit thread start callback must be called _before_ the Thread
object can be created.

(mono_thread_init): Removed much object creation code that is no
longer needed.  No managed code is called from here now.

* object.c (mono_runtime_exec_managed_code): Create a subthread
for Main, and call back to the runtime to use it.
Set the exit code when Main exits.

* gc.c: Make sure domain finalisation happens in a subthread.
Re-enable threaded GC, fixing bug 31333 (again).

* environment.c: System.Environment internall calls (so far just
ExitCode is here, the others are still in icall.c)

* appdomain.c (mono_runtime_cleanup): All threads running managed
code should have finished before mono_runtime_cleanup() is
reached, so no need to clean up threads.

2003-01-23  Dick Porter  <dick@ximian.com>

* mono.c: Use mono_runtime_exec_managed_code() to run all managed
code in a subthread.

* jit.c: Changed thread start and attach callbacks to pass the
thread ID, not the MonoThread pointer.  Arrange that managed code
execution will fail an assertion in the main thread, just to be
sure.

2003-01-23  Dick Porter  <dick@ximian.com>

* interp.c: Use mono_runtime_exec_managed_code() to run all
managed code in a subthread.

svn path=/trunk/mono/; revision=10838
19 files changed:
mono/interpreter/ChangeLog
mono/interpreter/interp.c
mono/jit/ChangeLog
mono/jit/jit.c
mono/jit/mono.c
mono/metadata/ChangeLog
mono/metadata/Makefile.am
mono/metadata/appdomain.c
mono/metadata/appdomain.h
mono/metadata/environment.c [new file with mode: 0644]
mono/metadata/environment.h [new file with mode: 0644]
mono/metadata/gc.c
mono/metadata/icall.c
mono/metadata/object.c
mono/metadata/object.h
mono/metadata/threadpool.c
mono/metadata/threads.c
mono/metadata/threads.h
samples/embed/teste.c