[threads] Replace use of W32Handle by MonoOSEvent for MonoThreadInfo exited event...
authorLudovic Henry <ludovic@xamarin.com>
Fri, 28 Oct 2016 21:00:54 +0000 (17:00 -0400)
committerGitHub <noreply@github.com>
Fri, 28 Oct 2016 21:00:54 +0000 (17:00 -0400)
commitf588b336fcb5e0e69cb3c37487711f2452fb1f7a
treedf10f2c5deb155bd5cbb4bdb580229e150ed26e7
parent016709fe52e921416322982f8185925f83de5866
[threads] Replace use of W32Handle by MonoOSEvent for MonoThreadInfo exited event (#3659)

* [mono-threads] Make thread wait platform specific

* [mono-threads] Replace thread w32handle use by event

This allows use to remove the MonoThreadInfo dependency on the w32handle on posix.

* [w32handle] Move them to metadata

w32handle are purely for managed support, and they shouldn't be used in the runtime.

* [mono-threads] Factor open/close thread handle

* [mono-threads] Factor exit thread

* [mono-threads] Factor platform register/unregister thread

* [mono-threads] Use ThreadHandle on all platforms

* [threads] Fix mutex abandonning for main thread

According to the comment, the intent is to abandon the mutex hold by the current thread. This intent was conveyed by the previous code when the threading code was still in the io-layer.
40 files changed:
mcs/class/corlib/System.Threading/Thread.cs
mcs/class/corlib/System/Environment.cs
mono/io-layer/error.c
mono/io-layer/io.c
mono/io-layer/locking.c
mono/io-layer/posix.c
mono/io-layer/processes.c
mono/io-layer/sockets.c
mono/io-layer/wait.c
mono/io-layer/wait.h
mono/io-layer/wapi-private.h
mono/io-layer/wapi.c
mono/metadata/Makefile.am
mono/metadata/appdomain.c
mono/metadata/attach.c
mono/metadata/file-io.c
mono/metadata/gc.c
mono/metadata/object-internals.h
mono/metadata/process.c
mono/metadata/socket-io.c
mono/metadata/threads-types.h
mono/metadata/threads.c
mono/metadata/w32event-unix.c
mono/metadata/w32handle-namespace.h
mono/metadata/w32handle.c [new file with mode: 0644]
mono/metadata/w32handle.h [new file with mode: 0644]
mono/metadata/w32mutex-unix.c
mono/metadata/w32semaphore-unix.c
mono/mini/aot-compiler.c
mono/mini/debugger-agent.c
mono/mini/driver.c
mono/mini/mini-runtime.c
mono/unit-tests/test-conc-hashtable.c
mono/utils/Makefile.am
mono/utils/mono-threads-posix.c
mono/utils/mono-threads-windows.c
mono/utils/mono-threads.c
mono/utils/mono-threads.h
mono/utils/w32handle.c [deleted file]
mono/utils/w32handle.h [deleted file]