Move thread management from sgen to utils. Move smr from MonoInternalThread to thread...
authorRodrigo Kumpera <kumpera@gmail.com>
Wed, 6 Apr 2011 03:24:04 +0000 (00:24 -0300)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 8 Apr 2011 00:12:10 +0000 (21:12 -0300)
commitb998e8e9436e885b3b2f47696eecd942eff1a227
tree803fd94d07c93bfb58126423d9dd646a0080614c
parent9aff465129ad029e8bbe70927ab3e3ccde2a71aa
Move thread management from sgen to utils. Move smr from MonoInternalThread to thread_info.

* mono-threads.c: An implementation of low level thread management that
fits what sgen needs. It uses hazard pointers to manage the thread list
since we can't protect it with the GC lock as this would cause boehm to
deadlock. This requires us to move small_id one layer down.

* Thread.cs:
* object-internals.h:
* threads.c: Small id is now stored on MonoThreadInfo so it can be
used by lower layers of the runtime such as sgen.

* sgen-major-copying.c:
* sgen-os-mach.c:
* sgen-os-posix.c:
* sgen-gc.h:
* sgen-gc.c: Replace sgen's thread management code with
the new one.

* boehm-gc.c: Hookup the new thread management code. Boehm's
own management code is not been replaced as I'm too much of
a coward to mess with it.

* hazard-pointer.c: Adjust to the new location of small_id.
14 files changed:
mcs/class/corlib/System.Threading/Thread.cs
mono/metadata/boehm-gc.c
mono/metadata/object-internals.h
mono/metadata/sgen-gc.c
mono/metadata/sgen-gc.h
mono/metadata/sgen-major-copying.c
mono/metadata/sgen-os-mach.c
mono/metadata/sgen-os-posix.c
mono/metadata/threads.c
mono/utils/Makefile.am
mono/utils/hazard-pointer.c
mono/utils/hazard-pointer.h
mono/utils/mono-threads.c [new file with mode: 0644]
mono/utils/mono-threads.h [new file with mode: 0644]